CREATING SSH-KEYS


♣If you wish to navigate back to the table then→

So in order to use the SSH-Keys, you will need to CREATE them. So in order to create an SSH-Key the command is as shown:-

ssh-keygen -t KEY-TYPE -C "COMMENT"

The KEY-TYPE can be either: While the "COMMENT" is simply for your convenience, so that it makes it easier for you to recognize your SSH-Keys. Also; for for "efficency" purposes you can seperate the keys into their own folders when creating your SSH-Keys

Now while creating an SSH-Key the system will ask you where to store your key [If you do not enter a location then. it simply saves in the DEFAULT-LOCATION which is .ssh & if there was a key already present in the specified locations then the key will be OVERWRITTEN with the new one]
When creating/generating your SSH-Keys, you will most probably be asked to provide a password for extra security; please consider creating a password if you truly wish to protect your SSH-Keys.

Now you simply copy the PUBLIC-KEY part of the SSH-Key which is indicated by the ".pub" file-extension into a file called "authorized_keys" located in the Remote-Server's ".ssh" folder [It is also the same location where SSH-Keys are usually stored PERIOD]. Now the easiest way of doing it would be via a command:-

ssh-copy-id -i PUBLIC_KEY-LOCATION REMOTE-SERVER

This will automate the otherwise manual process of adding the keys [ESPECIALLY, if you had to work with multiple SSH-Keys] in a line-by-line fashion in that previously-mentioned file on the remote-server. Now you can simply connect to your remote-servers via SSH without using a password [Eventhough the password can be used as backup]

♣Now please proceed to the→