3 ms·
A couple of steps are needed before ssh -A. These can be automated in various ways depending on your preference. 1. make sure ssh-agent is running. Otherwise
by sigjuice 6y ago
A couple of steps are needed before ssh -A. These can be automated in various ways depending on your preference.
1. make sure ssh-agent is running. Otherwise, here is one way to run it.
exec ssh-agent bash
Make sure there is now an environment variable called SSH_AUTH_SOCK.
On my macOS system, it is always running, so I don't need to do this.
2. add your key(s) to the agent.
ssh-add # add all keys
ssh-add -i ~/.ssh/id_ed25519 # add a specific key
ssh-add -l # list keys in agent
3. ssh -A host1
Additional information like dot files are not provided in the remote session.
Once you are logged on to host1, you can invoke ssh host2 without needing ~/.ssh/id_ed25519 on host1.
If instead you say ssh -A host2, then from host2 you may ssh back into host1. So if you have a group of trusted machines, they can all ssh each other while ~/.ssh/id_ed25519 remains on a single machine.