In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the method of "Linux cancels SSH login password without entering password to log in". In daily operation, I believe many people have doubts about the method of Linux canceling SSH login password without entering password to log on. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "Linux cancel SSH login password without entering password to log in". Next, please follow the editor to study!
Sometimes we want to log in to SSH through another account, and usually we need to re-enter our password when we log in. However, for some users who do not want to remember too many passwords, this seems a bit troublesome, so how can I log in without entering a password?
Solution:
1. You need to log in to hostA as the user "aliceA".
two。 Use ssh-keygen to generate a pair of rsa public and private keys, and the generated key pair is stored in the ~ / .ssh directory.
$ssh-keygen-t rsa
3. Use the following command to create the ~ / .ssh directory under the aliceB user directory on the target host hostB. If the .ssh directory already exists on aliceB@hostB, this step will be skipped.
$ssh aliceB@hostB mkdir-p. Ssh
4. Copy the public key of user "aliceA" on hostA to aliceB@hostB to implement password-free ssh.
$cat .ssh / id_rsa.pub | ssh aliceB@hostB 'cat "" .ssh / authorized_keys'
From then on, there is no need to enter a password from ssh on aliceA@hostA to aliceB@hostB. (editor's note: the above operation of creating a directory and copying it can also be done in one step with a ssh-copy-id command: ssh-copy-id-I ~ / .ssh/id_rsa.pub aliceB@hostB)
Troubleshooting
1. Even after the key authentication takes effect, you may still need to enter the SSH password. If you encounter this situation, check the system log (such as / var/log/secure) to see if the following exception occurs.
Authentication refused: bad ownership or modes for file / home/aliceB/.ssh/authorized_keys
In this case, the failure of key authentication is due to incorrect permissions or owners of the ~ / .ssh/authorized_keys file. In general, this error occurs if this file is readable to all users except you. Change the permissions of the file in the following ways to correct the error.
$chmod 700 ~ / .ssh/authorized_keys
At this point, the study on "Linux cancels the SSH login password without entering the password to log in" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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
© 2024 shulou.com SLNews company. All rights reserved.