In this section, we are going to learn how to log in without a password using SSH. SSH is an open source network protocol and is used to log in to the remote servers to perform some actions. We can use the SSH protocol to transfer files from one computer to another. SSH uses public key cryptography.
- First, we are going to create a SSH key. The
ssh-keygen
command is used to create a SSH key. Run the command as follows:
$ ssh-keygen
You will get the following output:
Generating public/private rsa key pair. Enter file in which to save the key (/home/student/.ssh/id_rsa): /home/student/keytext Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/student/keytext. Your public key has been saved in /home/student/keytext.pub. The key fingerprint is: SHA256:6wmj6l9EcjufZhvwQ+iKIqEchO1mtEwC/x5rMyoKyeY student@ubuntu The key's randomart...