在本地创建一对公钥私钥
生成的私钥公钥是放在了这个地方
image.png
运行下面的命令:
ssh-keygen -t rsa -C "zy@xxx.com"
然后输入相关的路径位置以及名称
/Users/morris/.ssh是你电脑中存放公钥私钥的路径
Downloader就是将要创建的公钥私钥的名称
/Users/morris/.ssh/Downloader
然后输入密码,我这里没有输入密码
zhangyan@yan ~> ssh-keygen -t rsa -C "zy@xxx.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/morris/.ssh/id_rsa): /Users/morris/.ssh/Downloader
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/morris/.ssh/Downloader.
Your public key has been saved in /Users/morris/.ssh/Downloader.pub.
The key fingerprint is:
SHA256:bEWZ6MeXjWV1lim47JZrS9TtHs52Buvc2V0wrEN05cM zy@xxx.com
The key's randomart image is:
+---[RSA 2048]----+
| ..o. .B|
| ..o. .+*.|
| . .o o*oE.|
| ...o+=oo .|
| S..oo.+. |
| . .= .oo |
| ..+ =.|
| .o o=oO|
| ....+*=|
+----[SHA256]-----+
zhangyan@yan ~>
进入.ssh路径,就能看到创建的公钥和私钥
image.png
网友评论