Last Updated: February 25, 2016
·
33.34K
· pavangaikwad

ssh/sftp using private key

Got password-less ssh/sftp enabled on the server, wanted to quick login using the given private key w/o having to add it to id_rsa.

Here are the commands to do that.

SSH :

ssh -i /path/to/private/key user@hostname

SFTP:

sftp -oIdentityFile=/path/to/private/key user@hostname

Cheers!