关于github的ssh, permission denied(publickey)

简介:

http://www.douban.com/note/201614252/


关于github的ssh, permission denied(publickey)

2012-02-20 19:30:00
总之linux系统经常会出现这个问题.

下面是姐姐尝试过的一个command.可以一一使用咯.这个东西很~~~

先看你的能不能用:
ssh -T git@github.com

可以的话会告诉你:
hi your_name.....success.....but no shell access(具体忘了)

不行的话,你可能还没有rsa key pair, 要先generate. 记得要generate到root directory : ~/.ssh

ssh-keygen

之后问什么就都enter,就会default到root了.

之后要把id_rsa.pub file upload到你的github account,: account settings--->ssh--->add new ssh key.
记得copy&paste,什么都不要改!

现在按理来说应该可以了.但有时.....

如果还是不行的话,先试试:
$ chmod 700 ~/.ssh
$ chmod 600 ~/.ssh/*

还是不行的话,那就要建一个config file在ssh的directory里面. 如果有了,就直接add这些lines:

Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile [local path to private key half of github public key you provided]

我的出现了奇怪的syntx error,所有我没用最后一行,用clone command没问题.不知道这个identityfilei究竟是啥.....总之了.烦!

相关文章
|
9月前
|
存储 运维 安全
【运维知识高级篇】一篇文章带你搞懂GitHub基础操作!(注册用户+配置ssh-key+创建项目+创建存储库+拉取代码到本地+推送新代码到Github)
【运维知识高级篇】一篇文章带你搞懂GitHub基础操作!(注册用户+配置ssh-key+创建项目+创建存储库+拉取代码到本地+推送新代码到Github)
151 0
|
13天前
|
网络安全 数据安全/隐私保护
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas
|
28天前
|
Ubuntu Linux 网络安全
SSH 远程登录报错:Permission denied, please try again. 解决办法
SSH 远程登录报错:Permission denied, please try again. 解决办法
|
1月前
|
Shell 网络安全 开发工具
配置SSH时候,Permission denied问题解决方法
配置SSH时候,Permission denied问题解决方法
45 4
|
3月前
|
网络安全
github或gitee配置ssh
github或gitee配置ssh
25 0
|
7月前
|
Linux 网络安全 开发工具
[笔记]github SSH 配置
[笔记]github SSH 配置
|
8月前
|
存储 Linux 网络安全
Git 配置SSH,多个 Github 账号配置不同的SSH KEY(二)
Git 配置SSH,多个 Github 账号配置不同的SSH KEY
|
8月前
|
Shell 网络安全 开发工具
Git 配置SSH,多个 Github 账号配置不同的SSH KEY(一)
Git 配置SSH,多个 Github 账号配置不同的SSH KEY
|
8月前
|
网络安全 开发工具 数据安全/隐私保护
GitHub不再支持密码验证解决方案:SSH免密与Token登录配置
今天提交代码,push到GitHub上,突然出现这个问题。 remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information. fatal: unable to acce
|
9月前
|
开发工具 git
Git 使用小乌龟(TortoiseGit)拉取Github项目时报错【server sent :publickey】
Git 使用小乌龟(TortoiseGit)拉取Github项目时报错【server sent :publickey】
198 0