我正在嘗試設置與dreamhost和本地機器配對的SSH密鑰。我使用git bash作爲我的終端(使用mingw32)Dreamhost上的SSH密鑰
我可以ssh [email protected],我被要求輸入密碼。我已經在我的本地和共享Dreamhost服務器上創建了RSA密鑰。下面是我把我的git終端上的步驟:
$ scp ~/.ssh/id_rsa.pub [email protected]:~/
$ ssh [email protected]
[email protected]'s password: *****
$ (ls shows my local's id_rsa.pub in the ~ directory)
$ cd ~/.ssh
$ ls
id_rsa id_rsa.pub key_backup
$ cat ./id_rsa.pub >> authorized_keys (i know I could have just copied)
$ ls
authorized_keys id_rsa id_rsa.pub key_backup
vi authorized_keys shows my local's pubkey
$ chmod go-w ~
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/authorized_keys
我然後退出ssh連接,並輸入ssh [email protected]到我的本地shell
,我要求輸入密碼...我在這裏做錯了什麼?
我需要設置ssh-agent嗎?當我這樣做,並嘗試SSH添加我得到'無法打開連接到您的身份驗證代理'
感謝您的任何幫助!
編輯:這裏是SSH -v
$ ssh -v [email protected]
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to mysharedserver.com [xxx.xxx.xxx.xx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/User/.ssh/identity type -1
debug1: identity file /c/Users/User/.ssh/id_rsa type 1
debug1: identity file /c/Users/User/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debia
n-5
debug1: match: OpenSSH_5.1p1 Debian-5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc 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 'mysharedserver.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/User/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
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: /c/Users/User/.ssh/identity
debug1: Offering public key: /c/Users/User/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /c/Users/User/.ssh/id_dsa
debug1: Next authentication method: password
[email protected]'s password:
P.S.我生成的RSA密鑰是用密碼進行的,不能留空。我被告知這可以使用空密碼,但不能使用密碼生成密鑰。任何想法爲什麼這可能是問題,如果的確如此? –