Remote computer control has always been a concern for all users. There are different ways and protocols for doing this, depending on the operating system you use. In the past, users used insecure methods to communicate with the server and this caused many problems. SSH is a widely used and very secure protocol in this regard. In this article, I will teach you How to Configure SSH Passwordless Login on OpenSUSE. Check out the Linux VPS server packages that are available on the Eldernode website and purchase them if you want.
Table of Contents
How to Configure SSH Passwordless Login on OpenSUSE
What is SSH and What are its Features?
SSH stands for Secure Shell or Secure Socket Shell and is a network communication protocol that allows you to securely connect to a computer or remote server. Network administrators can manage the servers and applications remotely, transfer files from one computer to another, and execute the commands using SSH. It provides strong password authentication and public key authentication as well as encrypted data communications between two computers that are connected via an open network such as the Internet. This protocol is also using to create secure tunnels for other application protocols.
Some of the features of SSH are:
1- Secure File transfer
2- Secure Remote Command Execution
3- Secure Remote Logins
4- Port Forwarding
5- Access Control
6- Keys and Agents
How to Generate SSH Public/Private Key Pair
At first, we create the key pair by entering the following command:
You can specify the key type by using the above command with the -t flag. If you use the above command without any arguments, a 2048-bit RSA key will generated. By default, the private key is storing in the ~/.ssh/id_rsa directory and the public key is storing in the ~/.ssh/id_rsa.pub directory.
You can also generate a key pair with a custom name. If you want to use key pairs for interactive login, just set a passphrase when creating the key pair.
After generating the key pair, you need to confirm that it has been generated in the ~/.ssh directory. To do this, run the following command:
ls -la .ssh/my_key*
Now it’s time to upload the SSH key to Remote OpenSUSE Server by running the following command:
ssh-copy-id -i .ssh/my_key.pub admin@your_IPaddress
We use the -i flag in the above command to specify the public key path. Remember to enter your SSH password after requesting.
You may encounter the “Received disconnect from your_IPaddress port 22:2: Too many authentication failures, Disconnected from your_IPaddress port 22” error, in which case enter the following command:
ssh-copy-id -i .ssh/my_key.pub -o IdentitiesOnly=yes admin@your_IPaddress
Configuring SSH Passwordless Login on OpenSUSE
Before doing anything, verify remote passwordless login to the OpenSUSE server.
You should log in with a private key and enter your passphrase:
ssh -i .ssh/my_key admin@your_IPaddress
Now we will disable SSH Password Authentication.
You should setup passwordless authentication before doing so. Failure to do so may result in you being locked out of the OpenSUSE server.
In this step, set the PasswordAuthentication and ChallangeResponseAuthentication configuration directives to no and UsePAM to yes:
Save the settings you made and then restart the sshd daemon according to the following command:
sudo systemctl restart sshd
That’s it! After performing the above steps, any user on the OpenSUSE server who tries to log in with a password will encounter a “Permission denied” error.
Passwordless authentication is one of the well-known OpenSSH security practices. In this article, we taught you how to configure SSH Passwordless Login on OpenSUSE. I hope this article was useful for you. If you have any questions, you can contact us in the Comments.