$ ssh-keygen -o -t rsa -b 4096 -C "Zakariyya@facebook.com"
Generating public/private rsa key pair.
( 起个名字 ) Enter file in which to save the key (/c/Users/anan/.ssh/id_rsa): facebook
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in facebook.
Your public key has been saved in facebook.pub.
The key fingerprint is:
SHA256:fYY3j8+sQocxaCUw2O2AhknZhnww9RNo5dhaNUIDTs4 rabbitucute@facebook.com
The key's randomart image is:
+---[RSA 4096]----+
| o+O+OOoo |
| **X=o*o.. |
| =E *o + |
| o .+.o. |
| . .S o+= |
| o+.+ |
| . .. . |
| . + |
| ...+ |
+----[SHA256]-----+
重复操作,分别创建了 facebook 和 google,得到四个文件
$ cd .ssh
$ ls
google
google.pub
facebook
facebook.pub
大纲
细节
创建 ssh key 时起个名字
不要一路回车了,给这个文件起一个名字 不然默认的话就覆盖了之前生成的第一个
新密钥添加到SSH agent中
因为默认只读取id_rsa,为了让SSH识别新的私钥,需将其添加到SSH agent中:
创建 config 配置文件
测试