Posted by Hans-Henry Jakobsen
The following steps can be used to ssh from one system to another without specifying a password.
Notes:
Steps:
$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t rsa -f $HOME/.ssh/id_rsa -P ''
This should result in two files, $HOME/.ssh/id_rsa (private key) and $HOME/.ssh/id_rsa.pub (public key).
$ cat id_rsa.pub >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2
Depending on the version of OpenSSH the following commands may also be required:
$ cat id_rsa.pub >> $HOME/.ssh/authorized_keys $ chmod 0600 $HOME/.ssh/authorized_keys
An alternative is to create a link from authorized_keys2 to authorized_keys:
$ cd $HOME/.ssh && ln -s authorized_keys2 authorized_keys
$ ssh -i $HOME/.ssh/id_rsa server
Host server IdentityFile ~/.ssh/id_rsa
This allows ssh access to the server without having to specify the path to the id_rsa file as an argument to ssh each time.
Tags: ssh
Is it possible to eloborate further on steps 12, 13 and 14….I am confused about it.
Hi, I have fixed a typo in this post.
Thanks for the tip
I think there’s typo here. It’s not ‘id_dsa’ instead it’s ‘id_rsa’ in several places.
Yes, you are right.
I have fixed the typos, thanks :)