Mac系统下 查看或者生成 ssh

i奇异

关注

阅读 36

2022-03-12

一、打开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)

0 0 举报