How to SSH login without typing your password.

Secure Shell is a network protocol that is encrypted and stands for Secure Shell. Its goal is to provide a secure connection between the client and the server, and it accomplishes this by employing a variety of authentication methods. There is a password authentication system and a key authentication system, to name a couple of them.

Typing ssh <user>@<ip_address> is the basic command to connect to your server. After entering the command it will require you to enter your ssh password to enter and use your server. Even it requires putting a password first to log in, it might not be as secure as you think especially if you use a weak password. This setup can help you make a more secure and faster way to access your server.

These are the steps to set up your SSH

Note: Make sure you have OpenSSH installed and running

Step 1: Create SSH keys

To create new ssh keys to your computer, run command ssh-keygen -t ed25519 -f ~/.ssh/<filename>

Note:
– ed25519 is a type of algorithm for creating a public key.
– It is recommended to add a passphrase in your ssh keys

~/.ssh

Step 2: Copy your public key to the server.

Run command ssh-copy-id -i .ssh/<filename>.pub <user>@<ip_address> to automatically copy your public key from your local computer to your server.

After you copy the public key to your server, you can now log in without typing your password.

Step 3: Change sSH config file

Go to .ssh folder and find the config file. Add new config by running this command sudo nano .ssh/config

Host <name-of-your-choice>
HostName <ip_address>
IdentityFile ~/.ssh/<filename>
User <user_of_server>

After adding the configuration, you can now access your server by puting the Host you entered in the config file

Leave a Comment

Your email address will not be published. Required fields are marked *