Using the ssh-keygen command (open terminal/konsole and type):
~# ssh-keygen -t rsa
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Created directory ‘/home/user/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
The -t (type) option specifies the type of key to create. It can be “rsa” or “dsa” for protocol v2. The $HOME/.ssh stores the following:
– $HOME/.ssh/id_rsa – Which is your private key
– $HOME/.ssh/id_rsa.pub – Which is your public key
It’s best not to share key files with anyone else. But you can upload keys to a remote server using:
~# ssh-copy-id firstname.lastname@example.org
You can now log in to the remote server using:
~# ssh email@example.com
Disable the password for root login (Be careful)
Open up the SSH config file using an editor of your choosing:
~# nano /etc/ssh/sshd_config
In this file find the line that has PermitRootLogin and modify this:
To make the changes:
reload ssh & done.