(ssh client): >
ssh-keygen -t rsa
(saving the file in ~/.ssh/id_rsa as prompted)
2. Just hit the
passphrase. If you do use a passphrase, you will also need to use
ssh-agent so you only have to type the passphrase once per session.
If you don't use a passphrase, simply logging onto your local
computer or getting access to the keyfile in any way will suffice
to access any ssh servers which have that key authorized for login.
3. This creates two files: >
~/.ssh/id_rsa
~/.ssh/id_rsa.pub
4. On the target machine (ssh server): >
cd
mkdir -p .ssh
chmod 0700 .ssh
5. On your local machine (ssh client): (one line) >
ssh {serverhostname}
cat '>>' '~/.ssh/authorized_keys2' < ~/.ssh/id_rsa.pub
or, for OpenSSH, (one line) >
ssh {serverhostname}
cat '>>' '~/.ssh/authorized_keys' < ~/.ssh/id_rsa.pub
You can test it out with >
ssh {serverhostname}
and you should be log onto the server machine without further need to type
anything.
If you decided to use a passphrase, do: >
ssh-agent $SHELL
ssh-add
ssh {serverhostname}
You will be prompted for your key passphrase when you use ssh-add, but not
subsequently when you use ssh.