今天抽风无法用ppk提交github 一直提示网络问题,所以...,
https://docs.github.com/en/authentication/connecting-to-github-with-ssh
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=windows
ppk转openssh key
怎么生成ssh看里面,我的是ppk文件,一直用tortoisegit提交的,没配置ssh
ppk文件内容如下:
![](https://img.haomeiwen.com/i2815884/671e4f60e5c4ed6b.png)
用putty key载入的ppk文件
![](https://img.haomeiwen.com/i2815884/c0de687046f88e6a.png)
转openssh key
![](https://img.haomeiwen.com/i2815884/1f77d81926a8aa5c.png)
我这里是私钥ppk文件。
保存为sshkey放到用户目录下..ssh
echo %USERNAME%
就是你的用户名。我的是Administrator我的是
C:\Users\Administrator.ssh
进入.ssh文件夹
创建config
![](https://img.haomeiwen.com/i2815884/c21999e38cc8ea7a.png)
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/sshkey
Host github.com
Hostname ssh.github.com
Port 443
User git
Host aur.archlinux.org
IdentityFile ~/.ssh/sshkey
User aur
sshkey内容格式实际上是这样的
![](https://img.haomeiwen.com/i2815884/1e9fd5ee6b46b539.png)
命令生成法
C:\Users\Administrator>where ssh-keygen
C:\Windows\System32\OpenSSH\ssh-keygen.exe
C:\Users\Administrator>ssh-keygen -t rsa -b 4096 -C "your-email@example.com" -f .ssh/id_rsa_git
得到如下文件
网友评论