In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how ssh is set up to allow key login. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
We generally use SSH clients such as PuTTY to remotely manage Linux servers. However, the general password login is prone to the problem that the password is violently cracked. Therefore, in general, we will set the port of SSH to a port other than the default 22, or disable root account login. In fact, there is a better way to ensure security, and you can safely log in remotely using your root account-- that is to log in with a secret key.
1. Generate public and private keys # ssh-keygen-t rsa# ssh-copy-id-I / root/.ssh/id_rsa.pub root@192.168.10.103-p 222, test key login # ssh 192.168.10.103 / / if you need to specify the key path You can use-i3 to cancel the sshd password login # vim / etc/ssh/sshd_configPasswordAuthentication no / / yes to noChallengeResponseAuthentication no / / yes to noRSAAuthentication yes / / remove the previous comments PubkeyAuthentication yes / / remove the previous comments AuthorizedKeysFile .ssh / authorized_keys / / remove the previous comments
Restart sshd after the change will OK. Note here that you must first test whether the key can log in, and disable the password login after success, otherwise it is easy to put yourself outside the wall. If you find it inconvenient to log in more than one key and still want to log in with a password, there are two points to pay attention to.
1. Change the default port of SSH, and the firewall must be enabled.
2. Install fail2ban.
Thank you for reading! This is the end of the article on "how to set up ssh to allow key login". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out 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
© 2024 shulou.com SLNews company. All rights reserved.