一、生成ssh key
Last login: Wed Jan 3 21:23:25 on ttys000
jiangxingqideMacBook-Pro:~ jiangxingqi$ ssh-keygen -t rsa -C “xingqijiang@sohu-inc.com”
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/jiangxingqi/.ssh/id_rsa):
/Users/jiangxingqi/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/jiangxingqi/.ssh/id_rsa.
Your public key has been saved in /Users/jiangxingqi/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:NGqbgh2QjnwbuhPJyTV+lXvAvbX7jM1Da6UvTT7dfGQ “xingqijiang@sohu-inc.com”
The key's randomart image is:
+---[RSA 2048]----+
| |
| . |
| o . = |
|.o + B o . |
|+.*oo + S o . |
| *o+o+ + o . . oE|
| .o.+ o . o B+o|
| .. . .=* +=|
| .. .o=+.o|
+----[SHA256]-----+
二、查看
jiangxingqideMacBook-Pro:~ jiangxingqi$ cat ~/.ssh/id_rsa.pub
三、gitlab profile add an ssh key
四、验证
jiangxingqideMacBook-Pro:~ jiangxingqi$ ssh -T git@git.tv.sohuno.com
Welcome to GitLab, 姜兴琪(视频/实习生)!