Centos-免密登录
  Ft2RVYcwxBRK 2023年11月02日 76 0

CentOS操作系统修改hosts文件

vi /etc/hosts

修改主机名hostname

vim /etc/hostname

配置免密登录

node50配置访问node51

192.168.30.50 minio1

192.168.30.51 minio2

192.168.30.52 minio3


node50服务器

ssh-keygen -t rsa

[root@node50 ~]# 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:
SHA256:VGiBWA5Iw5PljJVN43eQEv6QIe+c8tXhHrfEap4H1O0 root@node50
The key's randomart image is:
+---[RSA 2048]----+
| oo+=**oo+.      |
|  =*oB+++o       |
|  ..o Boo o. .   |
|     o * +.o. .  |
|    . + S.+ +.   |
|     o . ..= .E  |
|      .   +..    |
|         o ..    |
|          o.     |
+----[SHA256]-----+
[root@node50 ~]# cd 
[root@node50 ~]# cd /root/.ssh
[root@node50 .ssh]# ssh-copy-id minio2
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host 'minio2 (192.168.30.51)' can't be established.
ECDSA key fingerprint is SHA256:HKijn3Gyz1K0m1+nJAjU+MZJ3RpYc4CDIdRMCbY+z+s.
ECDSA key fingerprint is MD5:f6:0c:04:9c:1b:02:dc:71:b4:7e:dd:36:78:8d:cb:37.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@minio2's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'minio2'"
and check to make sure that only the key(s) you wanted were added.

测试:

[root@node50 .ssh]# ssh minio2
Last login: Mon Apr  3 16:29:03 2023 from 172.16.1.1
[root@node51 ~]#
【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
Ft2RVYcwxBRK
作者其他文章 更多
最新推荐 更多

2024-05-31