本地主机:权限被拒绝(公钥、密码、键盘交互)

本地主机:权限被拒绝(公钥、密码、键盘交互)

我尝试在 Mac OS 中运行 Hadoop,但出现以下错误:

$ hstart


WARNING: Attempting to start all Apache Hadoop daemons as chaklader in 10 seconds.
WARNING: This is not a recommended production deployment configuration.
WARNING: Use CTRL-C to abort.
Starting namenodes on [localhost]
localhost: Permission denied (publickey,password,keyboard-interactive).
Starting datanodes
localhost: Permission denied (publickey,password,keyboard-interactive).
Starting secondary namenodes [macs-MacBook-Pro.local]
macs-MacBook-Pro.local: Permission denied (publickey,password,keyboard-interactive).
2018-08-14 13:59:34,949 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting resourcemanager
Starting nodemanagers
localhost: Permission denied (publickey,password,keyboard-interactive).

我查了一下谷歌,发现了类似的帖子。我提到Permission被拒绝是错误,我没有passwordless ssh正确设置。例如,ssh localhost 不应要求输入密码。

我运行了它ssh localhost,它确实要求输入密码。作为问题的解决方案,提到执行命令,

cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

我这样做了,然后当我运行 ssh localhost 时,系统会要求我输入密码(而不是密码)。

$ ssh localhost

Enter passphrase for key '/Users/chaklader/.ssh/id_rsa': 
Last login: Tue Aug 14 14:03:30 2018 from ::1

原来的问题并没有解决。还有另一篇文章提到执行该命令chmod og-wx ~/.ssh/authorized_keys,我执行后,它仍然保持不变。

我试图检查 id_rsa 里面的内容并找到信息,

$ cat ~/.ssh/id_rsa.pub
ssh-rsa 

AAAAB3NzaC1yc2EAAAADAQABAAABAQDB/1Ryk4mB2/9rxpvF21JWKBOyx+hgo572zp9ZNcLmj1FcNN9saJ0AfYcmkILowEoCKgzOCbAvapd+JsPomPMsuKD37AGvfF88YWAjKPYOg3wo5JMwIp/CEyk349satGWUy+Q99288iJcS5NKkhLEN1bMOyIpgbFFxmpCdFXNSl9UfeCN4oyndWJzmnHkI6C9mu4BWibcW3PkKkwI2HVPop14m3jRjHJvmwGzRQxp/bjUVRqSZ52KTuVMYRrCsKdd048tBHOK0ujjshpBCoedtFoXt3xP0B78WZyvgFr2Pj9DrgdFI+T7gkJUv4xbmtKfCOZR7yFVwoUtgAF5k/FC1 [email protected]


$ cat ~/.ssh/authorized_keys 
ssh-rsa 

AAAAB3NzaC1yc2EAAAADAQABAAABAQDB/1Ryk4mB2/9rxpvF21JWKBOyx+hgo572zp9ZNcLmj1FcNN9saJ0AfYcmkILowEoCKgzOCbAvapd+JsPomPMsuKD37AGvfF88YWAjKPYOg3wo5JMwIp/CEyk349satGWUy+Q99288iJcS5NKkhLEN1bMOyIpgbFFxmpCdFXNSl9UfeCN4oyndWJzmnHkI6C9mu4BWibcW3PkKkwI2HVPop14m3jRjHJvmwGzRQxp/bjUVRqSZ52KTuVMYRrCsKdd048tBHOK0ujjshpBCoedtFoXt3xP0B78WZyvgFr2Pj9DrgdFI+T7gkJUv4xbmtKfCOZR7yFVwoUtgAF5k/FC1 [email protected]

这对我来说看起来是相同的信息。这里错过了什么?

答案1

私钥不应受密码保护。 检查这篇文章以检查这一点

您的私钥权限设置是否正确?应设置为:

  chmod 600  ~/.ssh/id_rsa

相关内容