git SSH-key 在Windows下如何生成公钥和私钥

1.进入到C:\Users\dell\.ssh   

右键打开Git Bash Here

2.ssh-key -t rsa 

然后直接点击 enter enter enter

 

cd C:\Users\dell\.ssh  

或者直接到这个文件夹下面

打开这个文件id_rsa.pub

就看到秘钥了

3.查看id_rsa.pub上传公钥到服务器

输入 cat  id_rsa.pub

然后从ssh-rsa 全部复制,到服务器上,就可以使用git  ssh

 

todo:多个ssh增强版

https://help.github.com/articles/connecting-to-github-with-ssh/


checking for existing ssh keys
ls -al ~/.ssh


github generating a new SSH key
ssh-keygen -t rsa -b 4096 -C "[email protected]"
chose different name 
enter


Adding yout SSH key to ssh-agent 
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa


Add the SSH key to GitHub Account


Windows .ssh config
  Host github.com
  HostName ssh.github.com
  Port 443
 
  #Host gitlab.com
Host 192.168.100.100
RSAAuthentication yes
IdentityFile ~/.ssh/mail_rsa
User montotone

  AWS config
  Host git-codecommit.*.amazonaws.com
  User APKAJHAXILU5XNXVOW2Q
  IdentityFile ~/.ssh/id_rsa
  
Testing your connection to github
ssh -T [email protected]
 
   local gitlab 
  ssh -T [email protected]