- ssh key 生成
ssh-keygen -t rsa -C "your@mail.com" -b 4096
- copy后贴到github或者gitlab,copy命令如下例:
- Mac
pbcopy < ~/.ssh/github_rsa.pub
- Linux
xclip -sel clip < ~/.ssh/github_rsa.pub
- 配置ssh config,配置文件位于~/.ssh/config。内容如下
Host github.com
User getsu
Hostname github.com
IdentityFile ~/.ssh/github_rsa
Host gitlab.com
User getsu
Hostname gitlab.com
IdentityFile ~/.ssh/gitlab_rsa
网友评论