1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| # 检查是否能访问github
ssh -T git@github.com
# Permission denied (publickey).说明可以访问,但是没有权限
cd ~/.ssh
ssh-keygen -t rsa -C "lihan3238@163.com"
# 查看公钥
cat ~/.ssh/id_rsa.pub
# 生成ssh key后,需要将公钥添加到github上
# 添加私钥到ssh-agent
#如果报错,则先执行: eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
# 验证是否添加成功
ssh git@github.com
|