美文网首页
抛弃tortoisegit的ppk改用ssh配置文件提交git更

抛弃tortoisegit的ppk改用ssh配置文件提交git更

作者: 吉凶以情迁 | 来源:发表于2024-02-25 13:58 被阅读0次

今天抽风无法用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

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

ppk转openssh key

怎么生成ssh看里面,我的是ppk文件,一直用tortoisegit提交的,没配置ssh
ppk文件内容如下:


image.png

用putty key载入的ppk文件


image.png

转openssh key

image.png
我这里是私钥ppk文件。
保存为sshkey放到用户目录下..ssh
echo %USERNAME%就是你的用户名。我的是Administrator
我的是
C:\Users\Administrator.ssh
进入.ssh文件夹
创建config
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内容格式实际上是这样的

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
得到如下文件

相关文章

网友评论

      本文标题:抛弃tortoisegit的ppk改用ssh配置文件提交git更

      本文链接:https://www.haomeiwen.com/subject/gudaadtx.html