RSA and DSA are used as an algorithm for public-key encryption
- RSA keys have minimum key length of 768 bits and the default length is 2048 bit.The key length of DSA is limited to 1024 bit so one can generate stronger RSA keys than DSA keys.
- DSA encryption is faster as compared to RSA.
- RSA can be used for both encryption and signing whereas DSA can only be used for signing.
- RSA can be used with ssh v1 and v2 whereas DSA can only be used with v2
Server IP: 192.168.0.110
Client IP: 192.168.0.100
This command will generate a private(id_rsa) and a public(id_rsa.pub) key.
NOTE: Make sure you give a blank password when prompted as shown with blue color below
# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:
+--[ RSA 2048]----+
|ooo . |
|B. + . |
|*++ . |
|== . . |
|..o . S |
| . . . o |
| o . o E |
| . . . |
| ..o. |
# scp /root/.ssh/id_rsa.pub 192.168.0.100:/root/.ssh/authorized_keys
# chmod 600 /root/.ssh/authorized_keys
# chmod 700 /root/.ssh
Now restart the ssh services on the server and client machines
# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
Now try to connect your client server, you should be able to connect without password prompt
# ssh 192.168.0.100
# ssh-keygen -p
How to create password less ssh connection for multiple non-root users
Follow the below links for more tutorials
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
How to register Red Hat Linux with RHN (Red Hat Network )
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is kernel-PAE in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?