首页 新闻 会员 周边

GIT 密码问题 Permission denied, please try again.

0
悬赏园豆:200 [已解决问题] 解决于 2016-11-12 10:55

在自己的服务器建了一个git仓库  拉取的时候要密码 我不知道这个密码是什么

怎么设置密码     急急急~~在线等

$ ssh -vvv git@12XX.XXX.126.71
OpenSSH_7.3p1, OpenSSL 1.0.2j  26 Sep 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "120.27.126.71" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 120.27.126.71 [120.27.126.71] port 22.
debug1: Connection established.
debug1: identity file /i/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /i/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 120.27.126.71:22 as 'git'
debug3: hostkeys_foreach: reading file "/i/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /i/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 120.27.126.71
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
debug3: send packet: type 20
debug1: SSH2_MSG_KEXINIT sent
debug3: receive packet: type 20
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16                                                                                                     -sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,ext-info-c
debug2: host key algorithms: ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh                                                                                                     .com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519
debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-                                                                                                     cbc
debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,aes192-cbc,aes256-cbc,3des-                                                                                                     cbc
debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh                                                                                                     .com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh                                                                                                     .com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com,zlib
debug2: compression stoc: none,zlib@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: host key algorithms: ssh-rsa,ssh-dss
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysa                                                                                                     tor.liu.se
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysa                                                                                                     tor.liu.se
debug2: MACs ctos: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: MACs stoc: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: umac-64@openssh.com compression: none
debug3: send packet: type 34
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent
debug3: receive packet: type 31
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug2: bits set: 1480/3072
debug3: send packet: type 32
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug3: receive packet: type 33
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:tiAV3SUokj4NtXNEvSBvV1Q/rhMpzHdCwFu0XyGZngs
debug3: hostkeys_foreach: reading file "/i/.ssh/known_hosts"
debug3: record_hostkey: found key type RSA in file /i/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from 120.27.126.71
debug1: Host '120.27.126.71' is known and matches the RSA host key.
debug1: Found key in /i/.ssh/known_hosts:2
debug2: bits set: 1522/3072
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug2: set_newkeys: mode 0
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS received
debug2: key: /i/.ssh/id_rsa (0x60006bdb0)
debug2: key: /i/.ssh/id_dsa (0x0)
debug2: key: /i/.ssh/id_ecdsa (0x0)
debug2: key: /i/.ssh/id_ed25519 (0x0)
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /i/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /i/.ssh/id_dsa
debug3: no such identity: /i/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /i/.ssh/id_ecdsa
debug3: no such identity: /i/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /i/.ssh/id_ed25519
debug3: no such identity: /i/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
git@12X.XXX.XXX.71's password:

 

git
A心语的主页 A心语 | 初学一级 | 园豆:24
提问于:2016-11-07 18:37
< >
分享
最佳答案
1

需要配套的账户和密码,还有就是 ssh 协议最好是自己的仓库,如果是别人的使用 http 协议。

收获园豆:160
CodeHsu | 大侠五级 |园豆:5468 | 2016-11-08 10:04

我的是自己的仓库 我不知道账户密码指的是哪个密码

A心语 | 园豆:24 (初学一级) | 2016-11-11 15:57

@A心语: 当前用户的密码

CodeHsu | 园豆:5468 (大侠五级) | 2016-11-11 15:58

@seayxu: 无效还是让输入密码,我已经把本地id_rsa.pub复制到服务器.ssh/ authorized_keys了

A心语 | 园豆:24 (初学一级) | 2016-11-11 16:04

@seayxu: 那为什么没有让我输入账户名呢

A心语 | 园豆:24 (初学一级) | 2016-11-11 16:10

@A心语: 你用什么搭建的 git Server?

CodeHsu | 园豆:5468 (大侠五级) | 2016-11-11 16:16

@seayxu: 服务器上是linux   本地是windows

A心语 | 园豆:24 (初学一级) | 2016-11-11 16:20

是阿里云的linux

A心语 | 园豆:24 (初学一级) | 2016-11-11 16:20

@A心语: 不是系统,是git服务程序。
你试下这个:ssh -T git@120.27.126.71
如果要输入密码,那就是你的ssh 没有加进去

CodeHsu | 园豆:5468 (大侠五级) | 2016-11-11 16:25

@seayxu: 让输密码,是把本地生成的.ssh/id_rsa.pub 里面的内容复制到   服务器商对应文件夹

authorized_keys 里面吗

A心语 | 园豆:24 (初学一级) | 2016-11-11 16:37
CodeHsu | 园豆:5468 (大侠五级) | 2016-11-11 16:41

@seayxu: 我按照上面的方法做

chmod 700 /home/git/.ssh

chmod 600 /home/git/.ssh/authorized_keys

可是还是不行

A心语 | 园豆:24 (初学一级) | 2016-11-11 17:17

authorized_keys.lock  我没有这个文件

A心语 | 园豆:24 (初学一级) | 2016-11-11 17:17

@seayxu: 现在又出现这个

A心语 | 园豆:24 (初学一级) | 2016-11-11 17:47

@A心语: ssh地址格式:git@120.27.126.71:用户名/仓库名.git
出现这个一般是:

  • 仓库不存在(检查地址)
  • 超时了(网络问题,尝试重试)
  • 没有权限(确定本地的 id_rsa.pub 内容已添加至 git server)
CodeHsu | 园豆:5468 (大侠五级) | 2016-11-11 17:55
其他回答(4)
0

不是git账户密码就是注册时用的邮箱密码啦啦啦。。。

收获园豆:20
青青子衿619 | 园豆:300 (菜鸟二级) | 2016-11-07 19:03

不是git的账户密码 ,注册时只有用户名和邮箱没有密码 , 也不是服务器的登录密码

支持(1) 反对(0) A心语 | 园豆:24 (初学一级) | 2016-11-07 19:08

@A心语: 刚问了大牛,他说是git仓库密码,也就是权限。在不对就不知道啦啦啦,,,

支持(0) 反对(0) 青青子衿619 | 园豆:300 (菜鸟二级) | 2016-11-07 19:39
0

我觉得应该是git的账户和密码,你可以设置自己git账户的密码,然后再git clone试试呢

收获园豆:20
myEsn2E9 | 园豆:224 (菜鸟二级) | 2016-11-07 19:16
0

你解决了那个问题了吗,我遇到的问题和你的一样啊

墨瞋 | 园豆:477 (菜鸟二级) | 2017-01-16 15:27

你解决那个问题了吗,我遇到的问题也跟你一样啊,好烦呐,git clone一直都需要密码,也不知道是什么密码,搞了好久了,问题解决了能教教我吗,跪求!

支持(0) 反对(0) 一叶落知天下秋grow | 园豆:202 (菜鸟二级) | 2017-03-14 11:00

@一叶落知天下秋grow: 解决了,就是需要密码的,这是我的博客,做的总结,你可以看看

http://www.cnblogs.com/lixiaochao/p/6293316.html

支持(0) 反对(0) 墨瞋 | 园豆:477 (菜鸟二级) | 2017-03-14 11:04

@屌丝程序猿-小超人: 我给git或者其他用户设置密码都设不了,设置密码的时候出现"only one user namemay be specifified"  然后我转到用户权限下设置密码,又出现 "only root can specify a user name"  输入passwd的时候又提示:"(current)UNIX password",unix密码这是什么,我不记得我设置过啊,大神帮帮忙呗,搞的心好累

支持(0) 反对(0) 一叶落知天下秋grow | 园豆:202 (菜鸟二级) | 2017-03-14 15:09
0

问题解决了吗,能教教我吗,跟你问题一样的

 

一叶落知天下秋grow | 园豆:202 (菜鸟二级) | 2017-03-14 11:01
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册