[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 root@10.1.30.101
posted @ 2020-03-19 14:13  LeoShi2020  阅读(160)  评论(0编辑  收藏  举报