再次遇到 SSH Server And “Permission denied (publickey)
首先,我们要确定ssh 已经设置过了,并且成功了
遇到上述问题,是在我启动在伪分布式hadoop集群下执行的所有命令时,每次都要求输入密码,之前还是好好的,每次登录不需要密码
所以,我就回忆,哪里出错了,后来,想了想,可能是我一次把/home/下的文件权限全都递归修改为777了~~
到底是不是,权限乱改的问题呢,我们要找证据。
看执行日志,所以我们要学会善于查看日志~~
$ grep sshd /var/log/auth.log
Authentication refused: bad ownership or modes for file /home/zeq9069/.ssh/authorized_key
原因很清楚了。是目录权限不对。
方法是:
Fixing Authentication refused: bad ownership or modes for directoryFrom HowToGeekIf you get this error in your logs when trying to setup public key authenticated automatic logins, the problem is a permissions one.You’ll need to perform the following commands on the user account you are trying to setup:
chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
OK~~~设置完,hadoop命令运行不在需要每次输入密码确认了!
参考:blog.youkuaiyun.com/hanhuili/article/details/11055293