[笔记]github SSH 配置

github官方ssh配置教程
Git–SSH登录

git bash 密钥登录

检查现有密钥否

windows路径:C:\Users${用户名}.ssh
LInux路径:~/.ssh 或者 /home/${用户名}/.ssh
一般*.pub就是公钥了
没有.pub文件就是没有了

生成密钥

git自带ssh生成命令

ssh-keygen -t rsa -C xxx@xxx.com

添加密钥

  1. 登录github
  2. setting
  3. SSH and GPG keys
  4. New SSH Key
  5. Key一栏里面填上*.pub的内容

在这里插入图片描述

测试密钥

ssh -T git@github.com

这是我Centos系统成功是输出

ssh -T git@github.com
The authenticity of host 'github.com (20.205.243.166)' 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,20.205.243.166' (RSA) to the list of known hosts.
Enter passphrase for key '/root/.ssh/id_rsa': 
Hi ShiverZm! You've successfully authenticated, but GitHub does not provide shell access.

Windows反而没成功

$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
\302\226git@github.com: Permission denied (publickey).

使用密钥登录

TortoriseGit 密钥登录

https://www.cnblogs.com/zy20160429/p/7493693.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

二进制怪兽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值