Hello everyone, today I will introduce how to set up the SSH password-less logon function on Ubuntu14.04. The SSH server will allow you to log on only when the workstation has a correct (public/private) key pair for matching. Otherwise, access will not be allowed. Under normal circumstances, we need to connect to the SSH console and enter the user name and password. If both are correct, access is allowed. Otherwise, access is denied by the server. However, there is also a more secure login method than using a password. We can use the encryption key to perform password-less login during SSH login.
Hello everyone, today I will introduce how to set up the SSH password-less logon function on Ubuntu 14.04. The SSH server will allow you to log on only when the workstation has a correct (public/private) key pair for matching. Otherwise, access will not be allowed.
Under normal circumstances, we need to connect to the SSH console and enter the user name and password. If both are correct, access is allowed. Otherwise, access is denied by the server. However, there is also a more secure login method than using a password. We can use the encryption key to log on to SSH for password-less login.
If you want to enable this security method, simply Disable password logon and allow only the Encrypted Key to log on. In this way, a private key and public key are generated on the client computer. Then the client needs to upload the public key to the authorized_key file on the SSH server. Before the access is granted, the server and client will verify the key pair. If the public key on the server matches the private key submitted by the client, the access permission is granted. Otherwise, the access is denied.
This is a very safe way to authenticate to an SSH server. If you want to achieve secure login for a single SSH user login, this is also a highly respected method. The following describes how to enable SSH configuration without a password.
1. Install the Openssh server
First, we need to update our local database index. As shown in the following figure, we need to enter "apt-get update" first"
$ sudo apt-get update
Run the following command to install openssh-server:
$ sudo apt-get install openssh-server
2. Enable the openssh Service
After OpenSSH has been successfully installed on Ubuntu14.04, we need to start the OpenSSH service. Run the following command to start/start the service.
$ sudo service ssh start
Or
$ sudo /etc/init.d/ssh start
3. Configure the key pair
After we install and start the OpenSSH service. Now it's time for us to get the public/private key pair. Run the following command on the terminal:
$ ssh-keygen -t rsa
After running the preceding commands, we need to answer a series of questions. First, select the path to save the key. Press enter to select the default path, that is, a hidden. ssh folder in the home directory. The next prompt is a password reminder. I leave this blank (Press ENTER ). Then the key pair will be created.
After the key pair is generatedCopy the public key on the client to the SSH serverOr host to create a trust relationship with the client. Run the following command to copy the public key of the client to the server.
$ ssh-copy-id user@ip_address
After the public key is uploaded, we can disable SSH Login by password. To solve this problem, use the following command to open/Etc/ssh/ssh_config.
$ sudo nano /etc/ssh/sshd_config
Now, we need to remove several lines of comments as shown and assign values.
4. Restart the SSH service.
Finally, after configuring the SSH server, we need to restart the SSH service to make the changes take effect. Run the following command on the terminal or console to restart the instance.
$ sudo service ssh restart
Or
$ sudo /etc/init.d/ssh restart
Now, we can try to log on to the ssh server by using a key pair instead of a password.
Summary
Great! We have successfully configured a password-free logon to SSH. It is very secure to use an encrypted key pair for SSH Server Authentication. If you want to implement security authentication for a single user login over SSH, this is also a highly respected method. Therefore, if you have any questions or suggestions, please submit your feedback in the comments box. I'm glad you have read this article. I hope you will like encrypted SSH secure logon :-)
Approach to improving the SSH login authentication speed for Ubuntu http://www.linuxidc.com/Linux/2014-09/106810.htm
Enable SSH service for Android phones to remotely access Ubuntu 14.04 http://www.linuxidc.com/Linux/2014-09/106809.htm
How to add a dual authentication http://www.linuxidc.com/Linux/2014-08/105998.htm for SSH in Linux
Configure the SFTP environment http://www.linuxidc.com/Linux/2014-08/105865.htm for non-SSH users in Linux
Http://www.linuxidc.com/Linux/2014-06/103627.htm for configuring and managing SSH services on Linux
SSH getting started basic learning tutorials http://www.linuxidc.com/Linux/2014-06/103008.htm
SSH password-free login details http://www.linuxidc.com/Linux/2015-03/114709.htm
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2
This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-04/115825.htm