SSH Key Generation and Authentication
=========================
First of all you will have to generate SSH Key ( the private key ) on your linux local computer and then update your remote linux computer or server with the authorized_keys ( the public key ).
Inorder,to generate SSH Key on your
Linux Web Server system you can follow the below steps:-
1. Check if .ssh folder already exist under your home directory ( /home/user-name/.shh ).
If not create a folder .ssh
# mkdir .ssh
2.Now generate or create SSH key run ssh-keygen command.
# ssh-keygen -t rsa
Press enter for all the below options to save the default settings:
-> Enter file in which to save the key (/Users/exampleuser/.ssh/id_rsa):
-> Enter passphrase (empty for no passphrase):
-> Enter same passphrase again:
Now you have created the Keypair. You can find all the newly generated files in your .ssh folder.
# ls
id_rsa id_rsa.pub known_hosts
Now you need to copy the *.pub file to your remote computer or server.
SSH Key Authentication
===============
Copy the file id_rsa.pub to your web server and save it as authorized_keys under /home/user-name/.ssh/ .