学习笔记:ssh连接git@github.com
http://help.github.com/linux-key-setup/
http://help.github.com/multiple-keys/
过程中,因注册用户名为fannyluo,
而本机用户名为user01,产生错误
需添加路径
$ ssh-add ~/.ssh/id_rsa
?
运行:
$ ssh -v git@github.com
?
OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009debug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug1: Connecting to github.com [207.97.227.239] port 22.debug1: Connection established.debug1: identity file /home/user01/.ssh/identity type -1debug1: identity file /home/user01/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048debug1: identity file /home/user01/.ssh/id_dsa type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'github.com' is known and matches the RSA host key.debug1: Found key in /home/user01/.ssh/known_hosts:1debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/user01/.ssh/id_rsadebug1: Remote: Forced command: gerve fannyluodebug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Server accepts key: pkalg ssh-rsa blen 277Agent admitted failure to sign using the key.debug1: Trying private key: /home/user01/.ssh/identitydebug1: Trying private key: /home/user01/.ssh/id_dsadebug1: No more authentication methods to try.Permission denied (publickey).user01@user01-laptop:~/.ssh$ chmod 700 ~/.sshuser01@user01-laptop:~/.ssh$ chmod 600 ~/.ssh/*user01@user01-laptop:~/.ssh$ ssh -v git@github.comOpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009debug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug1: Connecting to github.com [207.97.227.239] port 22.debug1: Connection established.debug1: identity file /home/user01/.ssh/identity type -1debug1: identity file /home/user01/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048debug1: identity file /home/user01/.ssh/id_dsa type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'github.com' is known and matches the RSA host key.debug1: Found key in /home/user01/.ssh/known_hosts:1debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/user01/.ssh/id_rsadebug1: Remote: Forced command: gerve fannyluodebug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Server accepts key: pkalg ssh-rsa blen 277Agent admitted failure to sign using the key.debug1: Trying private key: /home/user01/.ssh/identitydebug1: Trying private key: /home/user01/.ssh/id_dsadebug1: No more authentication methods to try.Permission denied (publickey).user01@user01-laptop:~/.ssh$ ssh-add ~/.ssh/id_rsaIdentity added: /home/user01/.ssh/id_rsa (/home/user01/.ssh/id_rsa)user01@user01-laptop:~/.ssh$ ssh -v git@github.comOpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009debug1: Reading configuration data /etc/ssh/ssh_configdebug1: Applying options for *debug1: Connecting to github.com [207.97.227.239] port 22.debug1: Connection established.debug1: identity file /home/user01/.ssh/identity type -1debug1: identity file /home/user01/.ssh/id_rsa type 1debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048debug1: identity file /home/user01/.ssh/id_dsa type -1debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: server->client aes128-ctr hmac-md5 nonedebug1: kex: client->server aes128-ctr hmac-md5 nonedebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_GROUPdebug1: SSH2_MSG_KEX_DH_GEX_INIT sentdebug1: expecting SSH2_MSG_KEX_DH_GEX_REPLYdebug1: Host 'github.com' is known and matches the RSA host key.debug1: Found key in /home/user01/.ssh/known_hosts:1debug1: ssh_rsa_verify: signature correctdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_REQUEST sentdebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering public key: /home/user01/.ssh/id_rsadebug1: Remote: Forced command: gerve fannyluodebug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Server accepts key: pkalg ssh-rsa blen 277debug1: Remote: Forced command: gerve fannyluodebug1: Remote: Port forwarding disabled.debug1: Remote: X11 forwarding disabled.debug1: Remote: Agent forwarding disabled.debug1: Remote: Pty allocation disabled.debug1: Authentication succeeded (publickey).debug1: channel 0: new [client-session]debug1: Requesting no-more-sessions@openssh.comdebug1: Entering interactive session.debug1: Sending environment.debug1: Sending env LANG = zh_CN.utf8PTY allocation request failed on channel 0ERROR: Hi fannyluo! You've successfully authenticated, but GitHub does not provide shell access debug1: client_input_channel_req: channel 0 rtype exit-status reply 0debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0debug1: channel 0: free: client-session, nchannels 1Connection to github.com closed.Transferred: sent 2592, received 2904 bytes, in 0.8 secondsBytes per second: sent 3372.2, received 3778.2debug1: Exit status 1?