@Zoker git@osc的问题

Sherlcked 发布于 2015/02/07 22:54
阅读 568
收藏 0
Git

@Zoker


OpenSSH_6.6.1, OpenSSL 1.0.1h 5 Jun 2014

debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to git.oschina.net [124.202.141.153] port 22.
debug1: Connection established.
debug1: identity file /home/HY/.ssh/id_rsa type 1
debug1: identity file /home/HY/.ssh/id_rsa-cert type -1
debug1: identity file /home/HY/.ssh/id_dsa type -1
debug1: identity file /home/HY/.ssh/id_dsa-cert type -1
debug1: identity file /home/HY/.ssh/id_ecdsa type -1
debug1: identity file /home/HY/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/HY/.ssh/id_ed25519 type -1
debug1: identity file /home/HY/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 27:e5:d3:f7:2a:9e:eb:6c:93:cd:1f:c1:47:a3:54:b1
debug1: Host 'git.oschina.net' is known and matches the ECDSA host key.
debug1: Found key in /home/HY/.ssh/known_hosts:2
debug1: ssh_ecdsa_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,keyboard-interacti
ve
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/HY/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to git.oschina.net ([124.202.141.153]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
Welcome to Git@OSC, HowieHuang!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3332, received 3016 bytes, in 0.5 seconds
Bytes per second: sent 6970.3, received 6309.3
debug1: Exit status 0
加载中
0
Zoker
Zoker
git remote -v 也发出来看下
0
Sherlcked
Sherlcked

@Zoker

$ git remote -v

origin  git@git.oschina.net:hy/django-blog.git (fetch)
origin  git@git.oschina.net:hy/django-blog.git (push)
0
Zoker
Zoker
这都没问题啊,你发下你push的操作还有验证失败的log
0
Sherlcked
Sherlcked

@Zoker

$ git push -u origin master

git@git.oschina.net's password:
Permission denied, please try again.
git@git.oschina.net's password:
Permission denied, please try again.
git@git.oschina.net's password:
Permission denied (publickey,password,keyboard-interactive).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.


密码我输入的是git@osc 用户的登陆密码

Zoker
Zoker
你执行命令都是在同一个用户下吧?
0
Sherlcked
Sherlcked

@Zoker

一样的,bash下是HY@HY-PC /e/django_workspace/mysite (master)

cmd是C:\Users\HY

Zoker
Zoker
要都在git bash下执行这些命令哦
0
leo108
leo108

ssh方式应该是用rsa密钥对登录而不是密码登录吧,http方式才是输入用户名密码的

Zoker
Zoker
嗯嗯,他的问题是windows下面cmd和git bash的sshkey是不同的。
0
Sherlcked
Sherlcked

@Zoker

bash下

$ ssh -vT git@git.oschina.net
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Connecting to git.oschina.net [124.202.141.153] port 22.
debug1: Connection established.
debug1: identity file /c/Users/HY/.ssh/id_rsa type -1
debug1: identity file /c/Users/HY/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/HY/.ssh/id_dsa type -1
debug1: identity file /c/Users/HY/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/HY/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/HY/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/HY/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/HY/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2
debug1: match: OpenSSH_6.2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 27:e5:d3:f7:2a:9e:eb:6c:93:cd:1f:c1:47:a3:54:b1
debug1: Host 'git.oschina.net' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/HY/.ssh/known_hosts:1
debug1: ssh_ecdsa_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,keyboard-interacti
ve
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/HY/.ssh/id_rsa
debug1: Trying private key: /c/Users/HY/.ssh/id_dsa
debug1: Trying private key: /c/Users/HY/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/HY/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve
debug1: Next authentication method: password
git@git.oschina.net's password:
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve
Permission denied, please try again.
git@git.oschina.net's password:
debug1: Authentications that can continue: publickey,password,keyboard-interacti
ve


要我输入密码了....

Zoker
Zoker
回复 @Sherlcked : 有问题可以随时@我
Sherlcked
Sherlcked
回复 @Zoker : 原来如此.... 十分感谢!!
Zoker
Zoker
对啊,所以你要把在git bash下的key加到你个人公钥里:)
返回顶部
顶部