1.检查SSH-KEY是否已经生成过
ls -al ~/.ssh
(windows下的话,在 C:\Users\xxx\.ssh)
2.生成新的SSH-KEY
ssh-keygen -t rsa -C "your_email@example.com"
输入: id_rsa
输入:密码
重复输入:密码
3.生成成功
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
aa:dd:cc:80:f7:89:ee:7e:88:gg:ee:fc:b1:dc:ea:ff your_email@example.com
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| - |
| e . |
| S + . |
| ..4 + |
| +a.= . |
| .+b..+ |
| +==oo. |
+-----------------+
4.执行 ssh-add,解决权限问题。
5.查看生成成功的KEY
cat ~/.ssh/id_rsa.pub
内容如下:
ssh-rsa ..................
..........................
....your_email@example.com
6.拷贝id_rsa.pub的内容使用即可