首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Git要求SSH密码即使在ssh代理中也是如此。

Git要求SSH密码即使在ssh代理中也是如此。
EN

Stack Overflow用户
提问于 2017-11-07 10:59:56
回答 1查看 408关注 0票数 2

我每天在我的Mac上使用ssh代理的git,它运行得完美无缺。但是,在我的远程开发服务器上,我应该遗漏一些东西,因为在执行远程git操作时不能绕过SSH密码提示。

设置

  1. ssh-agent:ssh-add -L中列出了密钥: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCktk2+zRYGy0RdM6HJ8JFVPjiNknK7iN8ohdCGSX9fPQ..../home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket
  2. 该键与~/.ssh/config中的bitbucket相关联: 主机* IdentitiesOnly,IdentitiesOnly,ServerAliveInterval 600,ServerAliveCountMax 5,TCPKeepAlive,no,IdentitiesOnly,yes,主机位桶bitbucket.org,用户git,Hostname,bitbucket.org KexAlgorithms diffie-hellman-group1 1-sha1 1 Identityfile
  3. 环境变量export | grep SSH_A: SSH_AGENT_PID=30294 SSH_AUTH_SOCK=/tmp/ssh-IS3rVQtFwDxF/agent.30292
  4. 代理正在运行ps -e | grep -q ssh-agent && echo "SSH Agent is running"返回 SSH代理正在运行
  5. 权限ls -al ~/.ssh: 总计48K drwx18:22。drwxr-xR-x18用户,4,0K,11月。7: 11:52 .-rw30 :50配置配置/home/user/.dotfiles/machine-specific/base/ssh/config -rw7 11:22环境-服务器-rw30 11:02 known_hosts
  6. 我的“硬”/etc/ssh/ssh_config: AddressFamily BatchMode no CheckHostIP yes Ciphers chacha20-poly1305@openssh.com,美学256-gcm@openssh.com,yes 128-GCM@openssh.com,eas256-ctr,192-ctr,yes 128-ctr压缩是,ForwardAgent没有ForwardX11,GSSAPIAuthentication没有GSSAPIDelegateCredentials,GSSAPIDelegateCredentials* HashKnownHosts是SendEnv LANG LC_* HostbasedAuthentication no KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-sha256 MACs hmac-sha2-512-etm@openssh.com,hellman 160-etm@opsh.com,umac-128@etopsh.com,hmac-sha2-512,hmac-sha2-256,hmac- PasswordAuthentication 160 PermitLocalCommand no PermitLocalCommand no Port 22 Protocol 2 RSAAuthentication yes RhostsRSAAuthentication no StrictHostKeyChecking ask隧道

然而,

  1. 运行git clone bitbucket:team/project.git返回 输入密钥'/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket':的密码

调试

  1. 结果ssh -v bitbucket: OpenSSH_6.6.1,OpenSSL 1.0.1f 2014年1月6日debug1:读取配置数据/home/user/.ssh/config debug1: /home/user/.ssh/config第1行:为*debug1应用选项: /home/user/.ssh/config第10行:为bitbucket debug1应用选项:读取配置数据/etc/ssh_config debug1: /etc/ssh/ssh_config第12行:为* debug1: Hostname应用选项;重新读取配置debug1:读取配置数据/home/user/.ssh/config debug1: /home/user/.ssh/.ssh/config第1行:应用* debug1: /home/user/.ssh/.ssh/配置第10行:为bitbucket.org debug1应用选项:读取配置数据/etc/ssh/ssh_config debug1: /etc/ssh/ssh_config第12行:为*debug1应用选项:连接到bitbucket.org 104.192.143.2端口22。debug1:建立连接。标识文件/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket类型-1 debug1:标识文件/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket-cert类型-1 debug1:标识文件/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket类型-1 debug1:标识文件/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket-cert类型-1 debug1:启用协议2.0 debug1的兼容模式:本地版本字符串SSH-2.0-OpenSSH_6.1p1 Ubuntu-2 ubuntu2.8 debug1:远程协议版本2.0,远程软件版本conker_1.0.314-df0526e app-132 debug1: no match: conker_1.0.314-df0526e app-132 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT接收到的debug1: kex: server->client key 128-gcm@openssh.com无debug1: kex: client->server key 128-gcm@openssh.com无debug1: SendingSSH2_MSG_KEXDH_INIT debug1: ExpendingSSH2_MSG_KEXDH_REPLY debug1:服务器主机密钥: RSA 97:8C:隐藏:.隐藏:.debug1:主机'bitbucket.org‘是已知的,并且与RSA主机密钥匹配。/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket : debug1:在/home/user/..ssh/.ssh/已知的主机中找到密钥:1 debug1: ssh_rsa_verify:签名正确的debug1: SSH2_MSG_NEWKEYS sent debug1: SSH2_MSG_NEWKEYS sent debug1: SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS sent debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: authentication debug1: Next身份验证方法: publickey debug1: Trying私钥:debug1 debug1: key'/home/user/.ssh/id_rsa.from_user@server_to_git@bitbucket'::_parse_private2:缺少begin标记debug1: key_parse_private_pem: PEM_read_PrivateKey failed debug1: read PEM私钥完成:键入输入密码

有什么暗示吗?

EN

回答 1

Stack Overflow用户

发布于 2019-05-12 17:43:03

我刚刚发现,IdentitiesOnly需要公开密钥才能在本地机器上工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47156229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档