Skip to content

Instantly share code, notes, and snippets.

@sandyxu
Created July 8, 2016 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandyxu/aa0a61bfda83a21e5e5f59c74fbb1f0d to your computer and use it in GitHub Desktop.
Save sandyxu/aa0a61bfda83a21e5e5f59c74fbb1f0d to your computer and use it in GitHub Desktop.
SSHKit::Runner::ExecuteError: Exception while executing git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

报错信息如下:

SSHKit::Runner::ExecuteError: Exception while executing as gdw_dev@115.29.148.211: git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: The remote end hung up unexpectedly

SSHKit::Command::Failed: git exit status: 128
git stdout: Nothing written
git stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: The remote end hung up unexpectedly

1.尝试如下命令:

$ ssh -TTT gitlab@gitlab.mysite.com

Welcome to GitLab, Sandy Xu!

说明可以访问网站了.如果要求密码输入,说明连接地址正确,但是权限(ssh)没有配置

$ ps aux | grep ssh-agent

xuch 14827 0.0 0.0 2469952 3424 ?? S 2:23下午 0:00.05 /usr/bin/ssh-agent -l

如果 ssh-agent 服务超过一个,要kill掉所有ssh-agent。

通过ssh-add adds private key identities to the authentication agent

$ ssh-add -l

The agent has no identities.

这种情况说明没有添加私钥到ssh-agent

添加本地 私钥到ssh-agent

$ ssh-add ~/.ssh/id_rsa

查看私钥添加后是否成功

$ ssh-add -L

2048 SHA256:Td26FNx1bdn/kRQQ1UgdaotKk+F7AmiydE5mE0KXy8Y /Users/xuch/.ssh/id_rsa (RSA)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment