3 ms·
Is agent forwarding as simple as adding the -A flag? What additiomal info will agent-forwarding provide in the remote session? Dotfiles?
by l00sed 6y ago
Is agent forwarding as simple as adding the -A flag?
What additiomal info will agent-forwarding provide in the remote session? Dotfiles?
- sigjuice 6y agoA 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.
- ecesena 6y agoJust adding: don't make it a habit though. If other people have root access to the box where you connect to, they can take over your agent and impersonate you.