Enter file in which to save the key (/c/Users/Late Lee/.ssh/id_rsa): // 回车 Enter passphrase (empty for no passphrase): // 回车 Enter same passphrase again: // 回车
最后输出目录:
1 2
Your identification has been saved in /c/Users/Late Lee/.ssh/id_rsa. Your public key has been saved in /c/Users/Late Lee/.ssh/id_rsa.pub.
产生文件:id_rsa为私钥,id_rsa.pub为公钥。
进入cd /c/Users/Late\ Lee/.ssh/目录。拷贝公钥到Linux服务器。
1
ssh-copy-id -i id_rsa.pub root@99.69.96.66
输出信息:
1 2 3 4 5 6 7 8 9
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@99.69.96.66's password: // !! 此处输入目标系统的密码
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'root@99.69.96.66'" and check to make sure that only the key(s) you wanted were added.
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): 保存目录,默认,直接回车即 Enter passphrase (empty for no passphrase): 不输入密码,直接回车即可 Enter same passphrase again: 直接回车 Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:7PSMhZ5+ocFnRLSLDYrJFtCp2PfO5CNwQMYmnJHCqYo root@ecs-cba4-0002.novalocal The key's randomart image is: +---[RSA 2048]----+ |oo*. . .. | |o*=.o .. | |oB .. ... | |o +..+ o =.. | |o o=...S.+ | |E ... o+o*+ | | o = ==o. | | . =.. . | | . ... | +----[SHA256]-----+