Linux

localhost:權限被拒絕(公鑰,密碼,鍵盤互動)

  • August 14, 2018

我試圖在 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).

我查看了Google並找到了類似的文章。我提到 Permission denied 是錯誤,我沒有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 chaklader@macs-MacBook-Pro.local


$ cat ~/.ssh/authorized_keys 
ssh-rsa 

AAAAB3NzaC1yc2EAAAADAQABAAABAQDB/1Ryk4mB2/9rxpvF21JWKBOyx+hgo572zp9ZNcLmj1FcNN9saJ0AfYcmkILowEoCKgzOCbAvapd+JsPomPMsuKD37AGvfF88YWAjKPYOg3wo5JMwIp/CEyk349satGWUy+Q99288iJcS5NKkhLEN1bMOyIpgbFFxmpCdFXNSl9UfeCN4oyndWJzmnHkI6C9mu4BWibcW3PkKkwI2HVPop14m3jRjHJvmwGzRQxp/bjUVRqSZ52KTuVMYRrCsKdd048tBHOK0ujjshpBCoedtFoXt3xP0B78WZyvgFr2Pj9DrgdFI+T7gkJUv4xbmtKfCOZR7yFVwoUtgAF5k/FC1 chaklader@macs-MacBook-Pro.local

這對我來說看起來像相同的資訊。這裡錯過了什麼?

私鑰不應受密碼保護。 檢查這篇文章以檢查

您的私鑰的權限是否設置正確?應設置為:

 chmod 600  ~/.ssh/id_rsa

引用自:https://unix.stackexchange.com/questions/462457