localhost: Permission denied (publickey)
时间: 2023-11-15 22:58:46 浏览: 71
当在开启hadoop时候报错:localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)时,这通常是因为秘钥没有给自己所导致的。可以通过运行ssh-copy-id -i /home/hadoop/.ssh/id_rsa.pub hadoop@localhost来解决这个问题。
相关问题
localhost: Permission denied (publickey, password)
当执行sudo sbin/start-dfs.sh时出现"localhost: root@localhost: Permission denied (publickey,password)"的错误提示,这是因为在执行ssh命令时,无法进行免密码登录。这个问题可以通过修改ssh配置文件来解决。在文件/etc/ssh/sshd_config中,将PermitRootLogin属性的值改为yes,可以启用密码登录。具体方法是使用sudo vim /etc/ssh/sshd_config命令打开配置文件并修改,然后重新执行ssh root@localhost命令进行免密码登录。
如果在执行上述操作后仍然无法免密码登录,可以尝试使用ssh-keygen和ssh-copy-id命令来实现免密码登录。首先执行ssh-keygen -t rsa命令生成公钥和私钥,然后执行ssh-copy-id -i .~/ssh/id_rsa.pub root@localhost命令,将公钥复制到目标主机上实现免密码登录。
hadoop@localhost: Permission denied (publickey)
根据引用,出现"hadoop@localhost: Permission denied (publickey)"的错误是因为ssh配置没有正确设置。你需要确保你的秘钥是通过rsa生成的,并且将公钥添加到授权密钥列表中。你可以使用以下命令生成并添加rsa秘钥:
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
这样应该可以解决你的权限拒绝问题。