In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces you how to set SSH password-free login in Ubuntu14.04, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Normally, we need to connect to the SSH console to enter the user name and password. If both are correct, we can access it, otherwise the access is denied by the server. However, there is a more secure way to log in than with a password, and we can log in without a password through an encrypted key when we log in to SSH.
If you want to enable this secure way, we can simply disable password login and allow only encryption key login. In this way, a pair of private and public keys are generated on the client computer. Then the client has to upload the public key to the authorized_key file on the SSH server. The server and client computers verify the key pair before granting access. Access is granted if the public key on the server matches the private key submitted by the customer server, otherwise access is denied.
This is a very secure way to authenticate to a SSH server, and it's a highly respected way if you want to log in securely for a single SSH user. Here is a quick step through the configuration process of how to enable password-less login SSH.
1. Install the Openssh server
First, we need to update our local library index. So as you can see below, we need to type "apt-get update" first.
$sudo apt-get update
Now we can install openssh-server with the following command:
$sudo apt-get install openssh-server
two。 Enable the openssh service
After OpenSSH has been successfully installed on the Ubuntu14.04 operating system, we will start the OpenSSH service. The following command allows you to start / start the service.
$sudo service ssh start
Or
$sudo / etc/init.d/ssh start
3. Configure key pair
After we have installed and started the OpenSSH service. Now it's finally time for us to fix the public and private key pair and run the following command in the terminal:
$ssh-keygen-t rsa
After running the above command, we need to answer a series of questions. First select the path to save the key, press enter will choose the default path, that is, a hidden .ssh folder in the home directory. The next prompt is to enter a password to remind you. I personally leave this blank (enter directly). After that, the key pair is created, and it is done.
After the key pair is generated, we need to copy the public key on the client to the SSH server or host to create a trust relationship with the client. Run the following command to copy the client's public key to the server.
$ssh-copy-id user@ip_address
After uploading the public key, we can now disable the password login to SSH. To do this, we need to open / etc/ssh/ssh_config with a text editor with the following command.
$sudo nano / etc/ssh/sshd_config
Now, we need to remove a few lines of comments and do some assignments as shown in the following figure.
4. Restart the SSH service
Finally, after we have configured the SSH server, we need to restart the SSH service for the changes to take effect. Run the following command on the terminal or console to restart.
$sudo service ssh restart
Or
$sudo / etc/init.d/ssh restart
Now we can try logging in to the ssh server using a key pair without a password.
About how to set SSH password-free login in Ubuntu14.04 to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
# echo "/ dev/vdb1 / data01 ext4 defaults 0" > > / etc/fstab
© 2024 shulou.com SLNews company. All rights reserved.