kekePower

Having fun scripting and hacking Linux and Mageia

Using a different SSH key on another computer

Sometimes you may not want to add every single SSH key you have to access a remote resource.
I will tell you a good way to use existing keys you can add to your SSH config file.

I wanted to access a remote resource that I only had access to using a key from another computer, so I searched a little and found this solution that works like a charm.

Add these lines to your ~/.ssh/config file and give it a go.
Make sure all the files in the .ssh directory have the 0600 permissions set.

Host *.remote.server
User username
IdentityFile ~/.ssh/id_rsa.otherKey