To generate an ssh key in linux you have to execute the command ssh-keygen in command line.
While executing the command you will be prompted for a file where the key will be saved.It will also
prompt for a password for the key.
user@localhost: ssh-keygen -t ssa
Generating public/private ssa key pair.
Enter file in which to save the key (/home/user/.ssh/id_ssa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in id_ssa.
Your public key has been saved in id_ssa.pub.
The key fingerprint is:
Here it creates a private key and public key in the files /home/user/.ssh/id_ssa and
/home/user/.ssh/id_ssa.pub respectively..The passphrase(password) is used to protect the key.
This password will be asked when you connect through ssh