cd /root/.ssh
[root@localhost .ssh]# ssh-keygen -t rsa #创建
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): id_rsa #文件名称
Enter passphrase (empty for no passphrase): #密码
Enter same passphrase again: #确认密码
返回以下信息
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
50:f0:a0:54:e2:7d:81:cc:6c:8c:47:af:33:e6:f5:73 root@localhost.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
| oO=oo |
| o.+O= . |
| ooo + |
| + |
| = S |
| o + . |
| . o E |
| o |
| |
+-----------------+
[root@localhost .ssh]# ls
id_rsa id_rsa.pub