Setting Openssh to Always forward private ssh-key on Ubuntu

Beware! Use this with Caution – The below change will forward your private ssh-key to all servers that you connect to via SSH.

Firstly, create the following file with the below contents if it does not already exist on your system:

nano ~/.ssh/config
Host *
ForwardAgent yes

IdentityFile ~/.ssh/id_rsa

Set the correct permissions on the file:

chmod 600 ~/.ssh/config

Restart the openssh service for good measure..

service ssh restart

That’s all!

Any comments or questions? Get in touch here or Email me at [email protected]