在使用putty工具使用密钥远程登陆CentOS系统时,出现Putty server refused our key提示,解决办法:

1.查看是否关掉SELINUX。

相关命令:getenforce, setenforce

相关配置文件:/etc/selinux/config

 

2.查看sshd配置

相关配置文件:/etc/ssh/sshd_config

主要查看这4个参数:

PermitRootLogin yes (如果要用root身份远程登陆系统)
StrictModes no (如果StrictModes为yes必需保证存放公钥的文件夹的拥有与登陆
用户名是相同的.“StrictModes”设置ssh在接收登录请求之前是否检查用户家目录
和rhosts文件的权限和所有权)
PubkeyAuthentication yes (启用公钥认证机制)
AuthorizedKeysFile      .ssh/authorized_keys (设置私钥文件名,.ssh的目录权限必须是700或者600)

 

相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-07-11
  • 2022-12-23
  • 2021-07-11
  • 2021-06-18
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2021-05-28
  • 2021-11-17
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案