centos - git clone提示输入密码,公钥无效,在线急等高手解答
怪我咯
怪我咯 2017-04-26 09:01:56
0
4
865

环境:阿里云Centos 6.5,客户端msysgit最新版。
主要参考文章:http://freeloda.blog.51cto.com/2033581/1410562
遇到问题参考的链接,/q/1010000000445726
问题依旧。
问题:公钥已配置,且已拷贝到正确目录。git clone时提示输入密码。
万分着急。希望高手帮帮忙!!!

$ git clone git@42.96.xxx.xxx:/opt/data/git/zebenrepos.git

应要求,上msysgit 命令行使用ssh -vvv模式抓取的日志:

第一段:

zxl@ZXL-THINK /c
$ ssh -vvv git@42.96.1xx.2xx

第二段:

debug2: key: /c/Users/zxl/.ssh/id_ecdsa (0x0),
debug2: key: /c/Users/zxl/.ssh/id_ed25519 (0x0),
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mi
c,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-m
ic,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: /c/Users/zxl/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mi
c,password
debug1: Trying private key: /c/Users/zxl/.ssh/id_dsa
debug3: no such identity: /c/Users/zxl/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /c/Users/zxl/.ssh/id_ecdsa
debug3: no such identity: /c/Users/zxl/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/zxl/.ssh/id_ed25519
debug3: no such identity: /c/Users/zxl/.ssh/id_ed25519: No such file or director
y
debug2: we did not send a packet, disable method

第二段中怀疑没有尝试rsa,故第三段换了dsa

第三段

debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/zxl/.ssh/id_rsa
debug3: no such identity: /c/Users/zxl/.ssh/id_rsa: No such file or directory
debug1: Offering DSA public key: /c/Users/zxl/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mi
c,password
debug1: Trying private key: /c/Users/zxl/.ssh/id_ecdsa
debug3: no such identity: /c/Users/zxl/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /c/Users/zxl/.ssh/id_ed25519
debug3: no such identity: /c/Users/zxl/.ssh/id_ed25519: No such file or director
y
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@42.96.1xx.2xx's password:

看看这日志,实在没搞懂,为什么dsa已经试通了,还去输入密码?

怪我咯
怪我咯

走同样的路,发现不同的人生

모든 응답(4)
黄舟

요약하자면: (1) Centos에서 이 문제는 s_home_t의 디렉터리 레이블과 관련이 없으며 SELinux와도 크게 관련이 없습니다. 내 컴퓨터에는 .ssh 레이블이 전혀 없으며 selinux 구성을 수정하지 않았습니다.
(2) 온라인 튜토리얼을 참고할 때는 각별히 주의하세요. 예비 분석에 따르면 /etc/passwd 편집 시 git ssh 액세스가 비활성화되면 문제가 발생하는 것으로 나타났습니다.

git:x:500:500::/home/git:/bin/bash ##이 줄을 주석 처리

git:x:500:500:git 버전 제어:/home/git:/usr/bin/git-shell

참고: 아래쪽 줄에 있는 두 숫자(UID여야 함)는 원래 숫자(윗줄에 주석 처리됨)와 동일해야 합니다. 부주의하면 문제가 여기에 있다고 결코 생각하지 못할 것입니다!

漂亮男人

https 링크로 저장소를 복제할 수 있습니다. SSH 링크로 저장소를 복제해 보세요. 일반적으로 두 개의 링크가 있습니다.
이 문제가 발생하여 이렇게 해결했습니다.

淡淡烟草味

git clone의 후속 명령을 알려주세요

迷茫

전혀 도움이 되지 않습니다. 자세한 내용은 모르겠습니다

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!