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 ~]#