1. 設(shè)置Git的user name和email:
$ git config --global user.name "xuhaiyan"
$ git config --global user.email "haiyan.xu.vip@gmail.com"
2. 查看是否已經(jīng)有了ssh密鑰:cd ~/.ssh
3. 生成密鑰
$ ssh-keygen -t rsa -C “haiyan.xu.vip@gmail.com”
按3個(gè)回車蹦玫,密碼為空焰望。
Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………
最后得到了兩個(gè)文件:id_rsa和id_rsa.pub
4.
$ eval ssh-agent
(是~鍵上的那個(gè)`)
5. 添加密鑰到ssh
ssh-add 文件名