ssh git设置命令行

#列出key
ls -al ~/.ssh

#生成key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

#判断ssh-agent可用
ssh-agent -s
#若执行ssh-add /path/to/xxx.pem是出现这个错误:Could not open a connection to your authentication agent,则先执行如下命令即可:
ssh-agent bash

#添加key到ssh-agent
ssh-add ~/.ssh/id_rsa

#复制sshkey
clip < ~/.ssh/id_rsa.pub

#测试
ssh -T git@github.com

 

posted @ 2016-01-06 18:20  sulerzh  阅读(613)  评论(0编辑  收藏  举报