Using SSH Keys - Video Tutorial
Using ssh keys instead of password authentication allows you to speed up and automate your SSH logins. Ideal for for scripts that require you copy files etc. Below shows you the steps on how to set up SSH Keys. The commands that were run within the video tutorial are :
[root@server ~]# ls -lha ~/.ssh
[root@server ~]# ssh email@example.com
[root@client ~]# ssh-keygen -t rsa
There are a number of reasons why your SSH-Keys may fail to connect you.
To debug sshd and ssh so that you can find the root cause run the following commands. We run the run the ssh daemon to listen on port 1234 so that we don't have to stop the existing sshd process.
[root@server ~]# /usr/sbin/sshd -d -p 1234
root@client ~]# ssh -vvv -p 1234 root@[server ip address]
A common cause of issues is permission issues. Ensure that '/admin/.ssh/authorized_keys' is set with permissions 600.
Also if you are connecting as another user you will need to edit '/etc/ssh/sshd_config' and add your user to the line that starts with 'AllowUsers'
Additional Resources :