配置ssh免密码登录后,仍提示输入密码

解决方法:

首先我们就要去查看系统的日志文件

tail /var/log/secure -n 20
 
Authentication refused: bad ownership or modes for directory /root

从字面上可以看出是目录的属主和权限配置不当,查找资料得知:SSH不希望home目录和~/.ssh目录对组有写权限,通过下面几条命令改下

chmod g-w /root

chmod 700 /root/.ssh

chmod 600 /root/.ssh/authorized_keys

相关文章:

  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2022-01-08
  • 2021-09-12
  • 2021-05-26
  • 2021-08-30
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2022-03-08
  • 2022-12-23
  • 2022-01-20
相关资源
相似解决方案