cd $HOME/.ssh
ssh-keygen -f id_rsa -t rsa
This will result: id_rsa
, id_rsa.pub
.
Now it is time to tell the remote account that we trust this test key.
You need to include the public key (id_rsa.pub
) in the file
$HOME/.ssh/authorized_keys
on the remote account, so log into the remote
account, open up $HOME/.ssh/authorized_keys
with your favourite editor and
paste it at the end of the file, or:
ssh user@remote mkdir -p .ssh
cat .ssh/id_rsa.pub | ssh user@remote 'cat >> .ssh/authorized_keys'
The SSH server is paranoid, and will refuse to honour your authorized_keys settings if they have poor file permissions, so you should lock down your files and directories on the remote server:
ssh user@remote
cd $HOME
chmod go-w .
cd $HOME/.ssh
chmod 700 .
chmod 600 *