hexo 部署找不到git为什么添加sshkey之后仍然出现git@github.com: Permission denied (publickey).

Categories
9101112131415
23242526272829
Recent Posts
Count per Day32409This post:247551Total reads:130454Total visitors:39Visitors today:1Visitors currently online:Meta在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
首先呢,我已经弄好了ssh的密钥,ssh -T 是可以的,返回:Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.但是,当我想要git push的时候,总是失败,提示是:Permission denied (publickey).fatal: Could not read from remote repository.
Please make sure you have the correct access rightsand the repository exists.FATAL Something's wrong. Maybe you can find the solution here: xxxxxxxxxxxx请问这是什么情况,
我执行的是git remote add origin :xxxxxxx/test.gitgit push -u origin master
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
我也遇到这个问题了,并且记录了解决方式
5. 看本地的.git/config设置的仓库url地址和github使用的链接地址是否一致如下图,如use https,则url需要用https的仓库地址,我的就是这个问题。
& cat .git/config
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/youcanping/MyBlog.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
设置Git的user name和email
git config --global user.name "yourname"
git config --global user.email "youremail"
生成SSH密钥
查看是否已经有了ssh密钥:cd ~/.ssh
如果没有密钥则不会有此文件夹,有则备份删除
生存密钥:
ssh-keygen -t rsa -C “haiyan.xu.”
按3个回车,密码为空。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
最后得到了两个文件:id_rsa和id_rsa.pub
添加密钥到ssh:ssh-add 文件名,需要之前输入密码.
在github上添加ssh密钥,这要添加的是“id_rsa.pub”里面的公钥。打开在设置中添加密钥
The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
测试成功就可以push code了.
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
出现相同异常情景:
(1)搭建个人Git服务器;
(2)备份旧 ssh keys ,并重新生成新的 ssh keys;
(3)想到旧的 ssh keys 是提供给GitHub要用的就又改回去;
(4)再 push 项目到 Github 的时候,提示让我输入 id_rsa。正确输入 id_rsa 后遇到了作者所述异常;
解决方案:
参考高票回答所述:在 .ssh 文件夹中执行 `ssh-add id_rsa`,再输入正确密码即可。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
我也遇到题主同样的问题,也没有在网上找到妥善的解决办法,但是通过重新配置密钥后解决了这个问题。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
需要重新选择下git上的ssh地址 因为默认配置的https地址。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
1 删除.ssh 下面的known_hosts
文件2 删除github上的密钥,并重新生成和添加密钥 3
还是不成功,就是你家的网络问题。 建议换一个网络。 并且github是不需要翻墙的。
该答案已被忽略,原因:
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。遇到的问题
今天心血来潮,想将intellij上的项目代码放到GitHub上管理。
在进行添加远程库的时候,出现了:出现Permission denied (publickey)
原因是 ./ssh目录默认在C:\Users\VULCAN\.ssh,而我在输入 ssh-keygen&命令的时候,是在intellij的项目位置。结果是,去查看.ssh目录,发现里面没有id_rsa和id_rsa.pub文件。
解决方案如下:
在在输入&ssh-keygen&命令时的位置找到id_rsa和id_rsa.pub文件,再复制到./ssh下。
再用ssh -T -v 这个命令查看下是否连接成功,成功了吗?并没有。因为我并没有在GitHub网站上添加我的SSH。
接下来,进行以下操作,用记事本打开 id_rsa.pub (注意,不是id_rsa,id_rsa是私钥,id_rsa.pub 是公钥),选中id_rsa.pub的全部内容,复制。
登录GitHub,在My&Profile的SSH里设置,添加。
再次使用ssh -T -v 这个命令查看下是否连接成功;
成功提示如下: You've successfully authenticated, but GitHub does not provide shell access.
如果过程中出现:Could not open a connection to your authentication agent.
解决方案如下:
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
复制这两行代码,运行即可(注意,要在./ssh的环境下)。
阅读(...) 评论()博客分类:
昨天在linux机子上装上了git,结果在连接github的时候出现 Permission denied (publickey),然后按照提示还是没有解决问题。
root@localhost:~/.ssh# ssh -vT
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /root/.ssh/config
debug1: Applying options for github.com
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: permanently_set_uid: 0/0
debug1: identity file /root/.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: 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-3ubuntu7
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(92) 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 /root/.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: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
上面是调试信息,后来不得已我给github的管理员发了封求救邮件(把上面的信息发给他们),发完之后才意识到昨晚是平安夜,谁知道今天早上竟然收到回复了(太敬业了)。
It seems the key you have added to your account is bogus. Could you make sure you copy the id_rsa.pub contents without changing anything.
按照他们的回复我发现那个publickey是我通过Secure CRT连接上用vim选择后右键复制的,我发现貌似中间有很多多余的空格,这个可能与我vim的设置有关吧,于是我用cat复制那个pubkey,然后连接就ok了。
window下面可以用gui里面的帮助复制pubkey。
我郁闷的是为什么有多余的空格,那个github中Account Settings” & Click “SSH Public Keys” & Click “Add another public key”的publickey还可以通过。
浏览 19096
xiaoshenge
浏览: 132819 次
来自: 十堰
楼主能搞个java版本的吗?你的php看不懂
jayson1987 写道为啥要这么复杂呢。拷贝深层的文件同时 ...
为啥要这么复杂呢。拷贝深层的文件同时保持目录结构直接使用cp
(window.slotbydup=window.slotbydup || []).push({
id: '4773203',
container: s,
size: '200,200',
display: 'inlay-fix'}

我要回帖

更多关于 git ssh 找不到 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信