[CentOS7]SSH免密码登录

  • 生成Key
[root@rac1 ~]# ssh-keygen
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:
SHA256:MOOCMZ0Tt2qcmgRx0t9hOgrhQBEe1kF5haFemJbF4Xc root@rac1
The key's randomart image is:
+---[RSA 2048]----+
|+B*o=+*.         |
|=+o+BBo.         |
|+ooB=*=o E       |
|.oo===o+.        |
| .oo*.. S        |
| ..+ .           |
|  o              |
|                 |
|                 |
+----[SHA256]-----+
  • 上传公钥
# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

猜你喜欢

转载自www.cnblogs.com/leoshi/p/12524065.html