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:
16:8e:e8:f2:1d:c9:b9:cf:43:9a:b3:3c:c1:1f:95:93 user@localhost
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