2014-04-23 51 views
0

我試圖通過ssh連接到我的嵌入式板。但在試圖通過ssh -v -l root [email protected]連接時,我得到了一系列的調試評論:從ssh登錄中刪除publickey

[email protected]:~$ sudo ssh -v -l root [email protected]

OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 22: Applying options for *

debug1: Connecting to foxboard2 [10.251.145.180] port 22.

debug1: Connection established.

debug1: permanently_set_uid: 0/0

debug1: identity file /root/.ssh/id_rsa type -1

debug1: identity file /root/.ssh/id_rsa-cert type -1

debug1: identity file /root/.ssh/id_dsa type -1

debug1: identity file /root/.ssh/id_dsa-cert type -1

debug1: identity file /root/.ssh/id_ecdsa type -1

debug1: identity file /root/.ssh/id_ecdsa-cert type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6

debug1: match: OpenSSH_5.5p1 Debian-6 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none

debug1: kex: client->server aes128-ctr hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP

debug1: SSH2_MSG_KEX_DH_GEX_INIT sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY

debug1: Server host key: RSA 18:14:33:1e:88:5f:ad:13:78:9f:36:10:b9:d2:27:e4

debug1: Host 'foxboard2' is known and matches the RSA host key.

debug1: Found key in /root/.ssh/known_hosts:1

debug1: ssh_rsa_verify: signature correct

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: Roaming not allowed by server

debug1: SSH2_MSG_SERVICE_REQUEST sent

debug1: SSH2_MSG_SERVICE_ACCEPT received

debug1: Authentications that can continue: publickey,password

debug1: Next authentication method: publickey

debug1: Trying private key: /root/.ssh/id_rsa

debug1: Trying private key: /root/.ssh/id_dsa

debug1: Trying private key: /root/.ssh/id_ecdsa

debug1: No more authentication methods to try.

Permission denied (publickey,password).

連接正在通過端口22建立的,這樣是沒有問題的。所以,顯然公鑰/私鑰身份驗證存在問題。因此,如何確保通過我的機器和主板的私鑰/公鑰都保持同步?或者更好的是,我該如何解決這個問題或完全刪除任何密鑰?

UPDATE

我試着通過ssh -o PubkeyAuthentication=no [email protected]沒有指定公共密鑰身份驗證連接到主板,但現在它問我輸入密碼。我檢查了site但我輸入的密碼不正確。我如何刪除密碼請求?

+0

它正在嘗試使用您的公鑰進行身份驗證,針對root的私鑰進行身份驗證並且失敗。要解決這個問題,你的〜/ .ssh.id_rsa.pub文件的內容需要附加到你試圖連接的服務器上的/root/.ssh/authorized_keys。這樣做需要你已經有一些方法來以root身份進行連接,或者有人可以爲你做。 –

回答

2

您可以將您的公鑰複製到使用服務器:

ssh-copy-id [email protected] 

它始終是更好地使用密鑰比密碼。

+0

謝謝你的回覆。但是,我在更新中提到我刪除了公鑰認證。但現在我收到密碼請求。無論如何,我根本不能連接到董事會,甚至不能複製該ID。當我輸入'ssh-copy-id user @ xx.xx.xx.xx'時,我得到:'/ usr/bin/ssh-copy-id:錯誤:找不到身份證明。 – Adam

+0

如果你沒有工作密鑰或密碼,你幾乎不走運。 :( –

+0

但爲什麼會問我任何時候我已禁用公鑰認證,我從來沒有設置密碼。有沒有一種方法,以消除後者? – Adam

0

確保您的~/.ssh目錄設置爲模式700(chmod 700 ~/.ssh),並且您的~/.ssh/authorized_keys設置爲模式600(chmod 600 ~/.ssh/authorized_keys)。

在你/etc/ssh/sshd_config文件中設置PasswordAuthentication no關閉密碼登錄。