0
点赞
收藏
分享

微信扫一扫

Mac系统下 查看或者生成 ssh

i奇异 2022-03-12 阅读 36
git

一、打开vim(terminal.app)查看本地是否存在SSH-Key

# ls -al ~/.ssh

# No such file or directory

# id_rsa id_rsa.pub

二、如果没有,生成新的SSH Key

#ssh-keygen -t rsa -C"you_email"

your_email:这里填写你在GitLab或者GitHub注册时的邮箱。

三、生成并添加SSH Key

# ssh-add ~/.ssh/id_rsa

四、查看SSH Key

# cat /Users/xxx/.ssh/id_rsa.pub

xxx是你的电脑用户名,例如:xiangMacBook-Pro:~ xiang$中的xiang关键字。

复制生成好的SSH Key 添加到 GitLab 或者GitHub中的SSH Key中即可。

举报

相关推荐

0 条评论