Your identification has been saved in /home/stu/.ssh/id_rsa. Your public key has been saved in /home/stu/.ssh/id_rsa.pub. The key fingerprint is: SHA256:ppKqA/AMnFd1V1+9Y6qPIQz7EHAjr2XgB+O+T//4z30 master-srv-01 The key's randomart image is: +---[RSA 4096]----+ | .. . ... o| | . . . . o| |. . .* o ..| |oo .o O . + | |.+. o BS o .| |. o ..=o= . | |. oo.+ o .. | |. . .o + o.+ . E| |.o. ... +o+o+ ..| +----[SHA256]-----+
生成以后,可以查看 .ssh 目录,可以看到生成了相关的文件,执行:
1
ls -la .ssh
系统显示:
1 2
-rw------- 1 stu stu 3243 Feb 13 00:36 id_rsa -rw-r--r-- 1 stu stu 739 Feb 13 00:36 id_rsa.pub
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/stu/.ssh/id_rsa.pub" The authenticity of host '192.168.31.60 (192.168.31.60)' can't be established. ECDSA key fingerprint is SHA256:jCPY99rJzLBUlUpBetgSr0RWbwRs/EGPhgcdJ0DS7bo. Are you sure you want to continue connecting (yes/no)? yes /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 stu@192.168.31.60's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'stu@192.168.31.60'" and check to make sure that only the key(s) you wanted were added.