xcode 操作GIT@OSC 总提示密码不对?

xujun82118 发布于 2015/05/14 20:21
阅读 1K+
收藏 0

大家好,提供个奇怪的问题:

      我按照以下这个链接部署了GIT项目成功,当时也COMMITE PUSH上去了,然后,过了一段时间(其间我没重新操作过GIT设置等),我编完了一些代码,再次commite push时,提出输入密码,然后,密码绝对是正确的,也被拒绝了。

http://my.oschina.net/zxs/blog/142544

      这种情况,我试了两次,都是当时可以,过一段时间就不行了,密码不对,又了重操作一遍。

     感谢大家啊。

 

加载中
0
Zoker
Zoker

你是不是升级了xcode 或者command line tools,那你需要重新设置一遍了。

0
xujun82118
xujun82118

引用来自“Zoker”的评论

你是不是升级了xcode 或者command line tools,那你需要重新设置一遍了。

最近是升级了,我现试一遍看看,谢谢
xujun82118
xujun82118
回复 @Zoker : 以前用gitHub时没遇到这种情况,它网络太慢才切过来的。。
xujun82118
xujun82118
回复 @Zoker : 你好,今天我又commit了,又提示输入密码,输入后又错了,我们另一个同事也同样的情况,怎么会这样呢??
Zoker
Zoker
结果如何了?
0
Zoker
Zoker
你把ssh -vT git@git.oschina.net 发出来看一下
0
xujun82118
xujun82118

你好,请看如下,谢谢:

jotekiMacBook-Air:Git-Followjoy-UI xujun$ ssh -vT git@git.oschina.net

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011

debug1: Reading configuration data /etc/ssh_config

debug1: /etc/ssh_config line 20: Applying options for *

debug1: Connecting to git.oschina.net [211.155.89.193] port 22.

debug1: Connection established.

debug1: identity file /Users/xujun/.ssh/id_rsa type -1

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

debug1: identity file /Users/xujun/.ssh/id_dsa type -1

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

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_6.2

debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2

debug1: match: OpenSSH_6.2 pat OpenSSH*

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: 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 e3:ee:82:78:fb:c0:ca:24:65:69:ba:bc:47:24:6f:d4

debug1: Host 'git.oschina.net' is known and matches the RSA host key.

debug1: Found key in /Users/xujun/.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,keyboard-interactive

debug1: Next authentication method: publickey

debug1: Offering RSA public key: /Users/xujun/.ssh/github_rsa

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Trying private key: /Users/xujun/.ssh/id_rsa

debug1: Trying private key: /Users/xujun/.ssh/id_dsa

debug1: Next authentication method: keyboard-interactive

debug1: Authentications that can continue: publickey,password,keyboard-interactive

debug1: Next authentication method: password

git@git.oschina.net's password: 

debug1: Authentications that can continue: publickey,password,keyboard-interactive

Permission denied, please try again.

git@git.oschina.net's password: 


Zoker
Zoker
你添加到gitosc的时github_rsa.pub 还是id_rsa.pub ?
0
xujun82118
xujun82118
回复 @Zoker : 你好,我是按照方法做的, 未提到你说的这两个文件,但应该是下面的状态,说明了什么呢,应该怎么改呢?
另外此项目我的确之前加到过github上,是否是它导致了这种现像?
jotekiMacBook-Air:.ssh xujun$ pwd
/Users/xujun/.ssh
jotekiMacBook-Air:.ssh xujun$ ls -a
. .. github_rsa github_rsa.pub known_hosts
jotekiMacBook-Air:.ssh xujun$ 

Zoker
Zoker
你现在只有github_rsa并没有id_rsa,不知道你加到gitosc的是id_rsa.pub还是github_rsa.pub,如果不是github_rsa.pub的话,那就只能重新添加了。
0
xujun82118
xujun82118

你好:

我把原来的github_rsa两个文件删了,

如果我按照他的说明,输入下面的Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa):diaosi, 则不能生成id_rsa.pub

如果我此处不输入diaosi, 只用空回车,则能生成github_rsa,然后我将github_rsa.pub加入网上公钥中,目前OK了,估计过段时间再看也OK。

不知道是不是他写的引导有问题。。。

//************

第一步:成生SSH密钥

打开终端命令工具,输入命令:ssh-keygen -t rsa -C "diaosi@gmail.com"

注意ssh-keygen没有空格。屏幕输出:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa):diaosi

....

返回顶部
顶部