本文介绍了Ubuntu Github的ssh密钥问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循本指南中的每一步:



当我到达最后时,我可以通过ssh到git@github.com获取响应:

但是当我去克隆我的repo时,它失败地说:

我使用了很多Github,但这是我第一次使用它来自Ubuntu电脑,有什么我在这里失踪?



任何帮助非常感谢。



Alex



编辑:

ssh -v git@github.com

  alex @ ubuntu:〜/ proj $ ssh -v git@github.com 
OpenSSH_5.3p1 Debian-3ubuntu4,OpenSSL 0.9.8k 2009年3月25日
debug1:读取配置数据/ etc / ssh / ssh_config
debug1:应用*
的选项debug1:连接到github.com [207.97.227.239]端口22.
debug1:已建立连接。
debug1:身份文件/home/alex/.ssh/identity类型-1
debug1:身份文件/home/alex/.ssh/id_rsa类型1
debug1:检查黑名单文件/ usr /share/ssh/blacklist.RSA-2048
debug1:检查黑名单文件/etc/ssh/blacklist.RSA-2048
debug1:身份文件/home/alex/.ssh/id_dsa类型-1
debug1:远程协议版本2.0,远程软件版本OpenSSH_5.1p1 Debian-5github2
debug1:匹配:OpenSSH_5.1p1 Debian-5github2 pat OpenSSH *
debug1:启用协议2.0的兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4
debug1:SSH2_MSG_KEXINIT发送
debug1:SSH2_MSG_KEXINIT收到
debug1:kex:服务器>客户端aes128-ctr hmac -md5 none
debug1:kex:client->服务器aes128-ctr hmac-md5 none
debug1:SSH2_MSG_KEX_DH_GEX_REQUEST(1024 debug1:期待SSH2_MSG_KEX_DH_GEX_GROUP
debug1:SSH2_MSG_KEX_DH_GEX_INIT发送
debug1:期待SSH2_MSG_KEX_DH_GEX_R EPLY
debug1:主机'github.com'是已知的,并且与RSA主机密钥匹配。
debug1:在/home/alex/.ssh/known_hosts:1
中发现密钥debug1:ssh_rsa_verify:签名正确
debug1:SSH2_MSG_NEWKEYS发送
debug1:期望SSH2_MSG_NEWKEYS
debug1:SSH2_MSG_NEWKEYS收到
debug1:SSH2_MSG_SERVICE_REQUEST发送
debug1:收到SSH2_MSG_SERVICE_ACCEPT
debug1:可继续的身份验证:publickey
debug1:下一个身份验证方法:publickey
debug1:提供公钥:/home/alex/.ssh/id_rsa
debug1:远程:强制命令:gerve AlexBaranosky
debug1:远程:禁用端口转发。
debug1:远程:禁用X11转发。
debug1:远程:代理转发已禁用。
debug1:远程:禁用Pty分配。
debug1:服务器接受密钥:pkalg ssh-rsa mix 277
debug1:远程:强制命令:gerve AlexBaranosky
debug1:远程:禁用端口转发。
debug1:远程:禁用X11转发。
debug1:远程:代理转发已禁用。
debug1:远程:禁用Pty分配。
debug1:认证成功(publickey)。
debug1:通道0:新[client-session]
debug1:请求no-more-sessions@openssh.com
debug1:输入交互式会话。
debug1:发送环境。
debug1:发送env LANG = en_US.utf8
频道0上的PTY分配请求失败
您好AlexBaranosky!您已成功通过身份验证,但GitHub不提供shell访问权限。
debug1:client_input_channel_req:channel 0 rtype退出状态回复0
debug1:client_input_channel_req:通道0 rtype eow@openssh.com回复0
debug1:通道0:free:client-session,nchannels 1
连接到github.com关闭。
转移:发送2592,收到2904字节,0.1秒
每秒字节数:发送44942.9,收到50352.7
debug1:退出状态1

运行输出: git clone git@github.com:AlexBaranosky / Sportello.git

 致命:无法创建工作树目录'Sportello':Permission denied 


解决方案

您是否以root身份运行Github指南中的所有命令?鉴于你已经注意到了这个解决方案,这是目前我能想到的唯一场景。

在任何方面以root身份工作都是非常危险的,应该避免尽我所能。



我强烈建议您将这些说明作为您自己的用户重新运行。我第二个雷的建议是用-v再试一次,我们可以从这一点帮助你。根本上使用root,特别是对于这个开发+推送过程来说,是非常危险的。它只需要删除一棵树( rm -rf tree * ),并且意外地在树和*,bam之间添加了一个空格,丢失了大量内容。你也可能做得更糟。


I followed every step given in this guide:http://help.github.com/linux-key-setup/

When I get to the end I am able to ssh to git@github.com, getting the response:

But when I go to clone my repo it fails saying:

I've used Github a lot, but this is my first use of it from an Ubuntu computer, is there something I am missing here?

Any help is greatly appreciated.

Alex

EDIT:

content of ssh -v git@github.com

alex@ubuntu:~/proj$ ssh -v git@github.com
OpenSSH_5.3p1 Debian-3ubuntu4, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /home/alex/.ssh/identity type -1
debug1: identity file /home/alex/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/alex/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2
debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 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: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/alex/.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: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/alex/.ssh/id_rsa
debug1: Remote: Forced command: gerve AlexBaranosky
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Remote: Forced command: gerve AlexBaranosky
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.utf8
PTY allocation request failed on channel 0
Hi AlexBaranosky! You've successfully authenticated, but GitHub does not provide shell access.
              debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to github.com closed.
Transferred: sent 2592, received 2904 bytes, in 0.1 seconds
Bytes per second: sent 44942.9, received 50352.7
debug1: Exit status 1

Output from running: git clone git@github.com:AlexBaranosky/Sportello.git

fatal: could not create work tree dir 'Sportello'.: Permission denied
解决方案

Did you run all of the commands in the Github guide as root? Given the solution you noted already, this is the only scenario I can imagine, currently.

Working as root, in any aspect, is insanely dangerous, and should be avoided if at all possible.

I highly advise re-running those instructions as your own user. I second Ray's suggestion of trying it again with -v, we can help you from that point. Using root at all, especially for this development+push process, is just dangerous. All it takes is for you to delete a tree (rm -rf tree*) and accidentally add a space between tree and *, bam, tons of content lost. And you could do a lot worse too.

这篇关于Ubuntu Github的ssh密钥问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 07:03