如何设置Git SSH密钥

1. SSH

存储在user/用户名/.ssh文件夹下

生成SSH密钥

$ ssh-keygen -t rsa -C "your_email"

2. 查看生成的公钥

$ cat ~/.ssh/id_rsa.pub

github帐户, Settings ->  SSH and GPG keys ->  New SSH key

查看SSH公钥

3. 修改git的remote url

当前remote url

$ git remote -v

复制SSH链接用URL,用于连接git

git remote set-url origin [email protected]:someaccount/someproject.git

 

转载于:https://www.cnblogs.com/GW977/p/8417164.html

你可能感兴趣的:(运维,git)