Doing It Manually
Generate keys on local desktop:
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
Append public key to server “kvm-example-server.com” as email@example.com:~/ssh/authorized_keys
Then repeat this to create connection from firstname.lastname@example.org to internal account: email@example.com
Not you can access firstname.lastname@example.org from desktop over kvm-example-server.com in one cmd:
ssh -A -t email@example.com ssh -A firstname.lastname@example.org
- -A to enable agent forwarding
- -t to force a pseudo-tty to be allocated.
A Better Way
and add lines:
Host server-kvm HostName kvm-example-server.com Host server-internal ProxyCommand ssh -q server-kvm nc -q0 192.168.122.13 22
Now that the proxy command is set up, you can connect to the ‘aoraki’ host simply by typing: