[root@inode ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. 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: 26:9f:d3:b6:82:9c:6e:76:57:dc:d7:1d:1d:86:91:c2 root@inode The key's randomart image is: +--[ RSA 2048]----+ | . .+ | | E o o | | . . o| | ..| | . S . . +| | + o o . +| | . o+ o. . | | * oo.. | | +.. o. | +-----------------+ [root@inode ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys [root@inode ~]# chmod 600 /root/.ssh/authorized_keys [root@inode ~]# chmod 700 /root/.ssh/ [root@inode ~]# ll .ssh 总用量 12 -rw-------. 1 root root 392 1月 6 00:51 authorized_keys -rw-------. 1 root root 1675 1月 6 00:51 id_rsa -rw-r--r--. 1 root root 392 1月 6 00:51 id_rsa.pub [root@inode ~]#