Ssh ssl key login
SSH Password-Less Setup
Create private & public keys:
(I have used my own server names as examples - BE SURE TO USE YOUR OWN SERVER NAMES!!!)
[jamie@server ~]$ ssh-keygen -b 4096
Save private key in VERY VERY SAFE PLACE!
Save public key in VERY VERY SAFE PLACE, as well as upload it to any server needing to log into using this key, by appending the /home/jamie/.ssh/authorized_keys file using cat. The public key uploaded to servers needing it to log into should be renamed to something that makes the key human identifiable, aka: server.dawgland.com.id_rsa.pub which will allow ssh login without using a password:
[jamie@server ~]$ scp server.dawgland.com.id_rsa.pub jamie@ermarc.net [jamie@server ~]$ ssh jamie@ermarc.net [jamie@server ~]$ cat server.dawgland.com.id_rsa.pub >> /home/jamie/.ssh/authorized_keys [jamie@server ~]$ chmod 600 /home/jamie/.ssh/authorized_keys
The chmod 600 command is required on only some Linux distros, but not on others, I have discovered.
For instance, with most Redhat based distributions, the chmod 600 command IS required.
But, I have found that with Debian based distros, it is not required!
To find out for sure, check the logs, specifically, /var/log/secure, with Redhat based systems,
and for Debian based systems in /var/log/auth.log for messages like this:
Jun 13 13:20:59 localhost sshd[17548]: Authentication refused: bad ownership or modes for file /home/jamie/.ssh/authorized_keys
The server.dawgland.com.id_rsa.pub key can be uploaded to any and all servers needing ssh access to and configured as above. This will allow you to log into the server without being prompted or needing to enter in your password!