public key無法登入怎麼辦? - Linux
By Donna
at 2013-01-29T07:15
at 2013-01-29T07:15
Table of Contents
情況是這樣的,昨天不慎把自己home底下的.ssh給誤刪掉了,
導致無法登入.為此我產生了一組新的key,public key就給
了管理員了,private就自己留著了. 管理員的操作如下:
(id_rsa.pub是public key)
1. $ mkdir /home/pipidog/.ssh
2. $ chomd 700 /home/pipidog/.ssh
3. put id_rsa.pub in /home/pipidog/.ssh <-- not a command !
4. $ cat id_rsa.pub >> /home/pipidog/.ssh/authorized_keys
5. $ chomd 644 /home/pipidog/.ssh/authorized_keys
看起來沒什麼問題,.ssh改成644, authorize_keys也改成700
但是登入的時候,總是被refuse.所以就用ssh -v 來debug了一下,但是
實在看不懂問題究竟出在哪裡. 不曉得誰可以指點一下?
//===================================================================
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to savcluster.physics.ucdavis.edu [169.237.43.49] port 22.
debug1: Connection established.
debug1: identity file /home/pi/.ssh/id_rsa type -1
debug1: identity file /home/pi/.ssh/id_rsa-cert type -1
debug1: identity file /home/pi/.ssh/id_dsa type -1
debug1: identity file /home/pi/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5
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: Host 'savcluster.physics.ucdavis.edu' is known and matches the RSA
host key.
debug1: Found key in /home/pi/.ssh/known_hosts:16
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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/pi/.ssh/id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/pi/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
--
導致無法登入.為此我產生了一組新的key,public key就給
了管理員了,private就自己留著了. 管理員的操作如下:
(id_rsa.pub是public key)
1. $ mkdir /home/pipidog/.ssh
2. $ chomd 700 /home/pipidog/.ssh
3. put id_rsa.pub in /home/pipidog/.ssh <-- not a command !
4. $ cat id_rsa.pub >> /home/pipidog/.ssh/authorized_keys
5. $ chomd 644 /home/pipidog/.ssh/authorized_keys
看起來沒什麼問題,.ssh改成644, authorize_keys也改成700
但是登入的時候,總是被refuse.所以就用ssh -v 來debug了一下,但是
實在看不懂問題究竟出在哪裡. 不曉得誰可以指點一下?
//===================================================================
OpenSSH_5.5p1, OpenSSL 1.0.0e-fips 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to savcluster.physics.ucdavis.edu [169.237.43.49] port 22.
debug1: Connection established.
debug1: identity file /home/pi/.ssh/id_rsa type -1
debug1: identity file /home/pi/.ssh/id_rsa-cert type -1
debug1: identity file /home/pi/.ssh/id_dsa type -1
debug1: identity file /home/pi/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5
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: Host 'savcluster.physics.ucdavis.edu' is known and matches the RSA
host key.
debug1: Found key in /home/pi/.ssh/known_hosts:16
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
debug1: Next authentication method: publickey
debug1: Trying private key: /home/pi/.ssh/id_rsa
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/pi/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
--
Tags:
Linux
All Comments
By Daph Bay
at 2013-02-02T19:25
at 2013-02-02T19:25
Related Posts
Ubuntu安裝在USB隨身碟大概要多少空間?
By Eden
at 2013-01-29T00:29
at 2013-01-29T00:29
crontab時間設定
By Cara
at 2013-01-28T14:25
at 2013-01-28T14:25
KDE 的 source code 管理準備從 svn 完全轉移到 git 上囉
By Joe
at 2013-01-28T13:06
at 2013-01-28T13:06
Ubuntu安裝在USB隨身碟大概要多少空間?
By Harry
at 2013-01-28T12:11
at 2013-01-28T12:11
Re: qsub 如何指定node
By Brianna
at 2013-01-28T06:08
at 2013-01-28T06:08