关于SSH

码云上有SSH的配置方法
1.生成 sshkey:

ssh-keygen -t rsa -C "xxxxx@xxxxx.com"  

# Generating public/private rsa key pair...
# 三次回车即可生成 ssh key

2.查看你的 public key
cat ~/.ssh/id_rsa.pub
3.判断是否成功
ssh -T git@gitee.com

但是如果返回不成功,就没写怎么解决了。
今天研究发现生成的id_rsa可以指定默认名称
ssh-keygen -t rsa -C 'xxxxx@xxxxx.com' -f ~/.ssh/name
多个网站的ssh需要配置config文件

# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/mayun

# GitLab.com server
Host gitlab.com
RSAAuthentication yes
IdentityFile ~/.ssh/id_rsa


# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容