We say that the private key is forwarded to the server1 in order to connect from server1 to server2.
- configure your environment. See configuration
- from your laptop, make a SSH connection to the first server
- Verify that you got login via your local agent. You should see on the screen
Authenticating with public key "rsa-key-..." from agent
- Example with Putty
- Verify that the client forward configuration has started an agent on the server. The echo command should show a value.
- Then try to connect to another server and you should be able to connect.
You can check it on your server with this command if you are using the sshd server
sshd -T | grep -i allowagentforwarding
otherwise you need to change the configuration file with the following value
Configuration of the ssh client:
- Create/Open the file ~/.ssh/config.
- Configures SSH agent forwarding for the specified Server1HostName by adding the following text to the config file
Host Server1HostName ForwardAgent yes # or for all server Host * ForwardAgent yes
Putty via Winscp
- Go to Winscp > Options > Preferences
- And allow forwarding be giving the -A option
- Set the agent forwarding option:
- Save the default settings