By default, SSH requires you to enter a password each time you log in. However, you can set up passwordless SSH login using a public/private key pair. This is a more secure way to log in, and it can also save you time.
To set up passwordless SSH login, you will need to generate a public/private key pair on your local computer. You can do this using the following command:
This command will prompt you to enter a file name for the key pair. You can accept the default file name, or you can specify your own.
You will also be prompted to enter a passphrase for the private key. It is important to choose a strong passphrase, as it will help to protect your private key from unauthorized access.
Once the key pair has been generated, you will need to copy the public key to the remote server. You can do this using the following command:
Once the public key has been copied to the remote server, you should be able to log in without having to enter a password. You can test this by running the following command:
If you are able to log in without being prompted for a password, then passwordless SSH login has been successfully configured.
To summarize, the three commands are:
ssh-keygen ssh-copy-id <username>@<host> ssh <username>@<host>