Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error occurred during login of putty key

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

When we log in using putty, we often use the key for verification for the sake of security. However, the author encountered an error when doing the experiment. Enter the user name and display: Server refused our key

After searching on the Internet, I found that many people encountered this problem and the key could not be used, so the author summarized a few points about this error:

The firewall is not turned off

This is the most common and easiest mistake, but it is also easy to solve, and there are two ways to turn off the firewall:

1. Command: # setenforce 0

Temporarily shut down and turn on automatically when the system is rebooted

2. Command: # vim / etc/selinux/config, change "enforceing" to "disabled", and take effect after restart

3. Command: # getenforce to view the status of firewall selinux at this time

Second, permission error

We save the public key content in the file / root/.ssh/authorized_keys, but we must change the permission of the directory .ssh to 700, and the file in it to 600 (or other users cannot change it), otherwise the system will automatically invalidate if it finds that our public key content is not secure enough.

Command: # chmod 700 / root/.ssh

Third, some people may because the sshd service is not configured correctly

/ etc/ssh/sshd_config 1. Find # StrictModes yes and change it to StrictModes no (change it to no after removing comments)

2. Find # PubkeyAuthentication yes and change it to PubkeyAuthentication yes (remove comments) 3. Find

# AuthorizedKeysFile .ssh / authorized_keys change to AuthorizedKeysFile .ssh / authorized_keys (remove

Note) 4. Save 5, / etc/rc.d/init.d/sshd reload reload

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.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report