Tuesday, February 7, 2012

ssh / sftp rsa public key

The idea is to:
1. Add the host's name to .ssh/config file
2. Create the id_rsa.pub file in the client machine using ssh-keygen
3. Copy the client's id_rsa.pub file to the host's .ssh/authorized_keys

~/.ssh/config

Host hostworld
     Port 22
     User username
     HostName hostname.world.ca

$ ssh hostworld

$ ssh-keygen
# just hit enter on passphrase

$ scp .ssh/id_rsa.pub hostworld:~

$ ssh hostworld

$ cat id_rsa.pub >> .ssh/authorized_keys

sftp://hostworld/home/username

sftp://username@hostname.world.ca:22/home/username


Offending key for IP in /home/jdoe/.ssh/known_hosts:13

get rid of line 13 in .ssh/known_hosts

No comments: