RSA key fingerprint is....Permission denied (publickey).需要SSH Key

53 篇文章 0 订阅
15 篇文章 0 订阅

换了新电脑,要克隆上传代码,直接告诉我被拒绝

Cloning into 'app'...
The authenticity of host '[bitbucket.bj.ssdn.accounts]:9887([10.10.2.1]:9887)' can't be established.
RSA key fingerprint is ...................fsdfdo.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[bitbucket.bjg.ssdn.accounts.intern]:7999,[10.10.2.1]:9887' (RSA) to the list of known hosts.
git@bitbucket.bj.ssdn.accounts: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Git 生成 SSH Key:
在C:\Users/你的用户名目录下,
用户名下的目录
也可以命令行查看是否已经有了ssh密钥:

cd ~/.ssh

然后进行生成,记得邮箱写正确:

 ssh-keygen -t rsa -C “feifei@zoe.com”

我的执行完,点3次回车,不设置密码

$ ssh-keygen -t rsa -C “feifei@zoe.com”
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/houhongf/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/houhongf/.ssh/id_rsa.
Your public key has been saved in /c/Users/houhongf/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:8AiRjN0xPTnmJebRHKC6ZNIj2mTD/6SBiYgM4UvDg5E “feifei@zoe.com”
The key's randomart image is:
+---[RSA 3072]----+
|   +.ooo.=..     |
| .. +..oX +      |
|E   . o= *       |
|++ . o +o        |
|o*B * . S        |
|**+X o           |
|=o+ + .          |
|     =           |
|    . .          |
+----[SHA256]-----+

.ssh文件夹下,会有新文件
有以下文件
我现在使用的是bitbucket.需要把id_rsa.pub公钥,打开复制,然后到git 库,添加key

点击bitbucket中,我的头像,选择Account settings,找到SSH keys,点击Add key,进行添加
add key
把上文中生成的.ssh文件夹下的id_rsa.pub复制下,添加到下图中,点击add即可

添加key
就可以在新电脑中正常操作git库了。

百度了下原因,Git是分布式的代码管理工具,远程的代码管理是基于SSH的,所以要使用远程的Git则需要SSH的配置。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值