[root@a ~]# ssh-keygen #生成公私钥
Generating public/private rsa key pair.
Enter file in which to save the key(/root/.ssh/id_rsa): #钥匙存放默认路径/root/.ssh
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: #回车,不需要密码
81:0b:c4:04:be:fb:f7:a3:59:3a:12:fd:c7:c3:1d:7e root@a
The key's randomart image is:+--[RSA2048]----+|.+o ||....||....||....||...S||....||....o o .||.. o+o = o E||.o++.o ..|+-----------------+[root@a ~]# ls /root/.ssh/ #查看钥匙
id_rsa id_rsa.pub #第一个私钥,第二个公钥
生成公私钥匙[root@a ~]# ssh-keygen #生成公私钥Generating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa): #钥匙存放默认路径/root/.sshCreated directory '/root/....