今天抽风无法用ppk提交github 一直提示网络问题,所以...,https://docs.github.com/en/authentication/connecting-to-github-with-sshhttps://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-blog.csdnimg.cn/img_convert/dbc8e1778260c0a8f892f4067062202c.webp?x-oss-process=image/format,png)
image.png
用putty key载入的ppk文件
![](https://img-blog.csdnimg.cn/img_convert/db9619d5ca96cb4ecede1a15e89353e4.webp?x-oss-process=image/format,png)
image.png
转openssh key
![](https://img-blog.csdnimg.cn/img_convert/7cb7dc171b2212af02bf4054fd8580bd.webp?x-oss-process=image/format,png)
image.png
我这里是私钥ppk文件。
保存为sshkey放到用户目录下..ssh
echo %USERNAME%
就是你的用户名。我的是Administrator
我的是
C:\Users\Administrator.ssh
进入.ssh文件夹
创建config
![](https://img-blog.csdnimg.cn/img_convert/fe472013cbb5f9586ce3cda010c13679.webp?x-oss-process=image/format,png)
image.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-blog.csdnimg.cn/img_convert/6b99d06a19444f92fb72edd1a2e4b966.webp?x-oss-process=image/format,png)
image.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
得到如下文件