To overcome this, we can use ssh-agent command, with ssh agent forwarding (-A) feature of ssh.
Start ssh-agent
$ eval `ssh-agent`
OR
$ ssh-agent bash
Use the agent forwarding feature of ssh to jump through many servers using the same key
$ ssh -A -i mine.key mine@server1
When you want to jump to server2, just run:
$ ssh -A mine@server2
and you will be connected to server2 using the same key (provided you already register the matching public key inside server2)
Once you have finished, do not forget to exit your ssh-agent, by typing exit, or killing the ssh-agent pid
$ kill `pidof ssh-agent`
No comments:
Post a Comment