1.配置ntp时间服务器,确保客户端主机能和服务主机同步时间
第一修改server端把服务器改为阿里云的然后允许node1端同步
#修改配置文件
#vim /etc/chrony.conf
server ntp.aliyun.com iburst
allow 192.168.253.130/24
第二修改node1的配置文件
server 192.168.253.129 iburst
然后重启服务和检查时间服务器是否是客户端的地址
[root@node1 ~]# chronyc sources -v
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| / 'x' = may be in error, '~' = too variable, '?' = unusable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^? 192.168.253.129 3 6 3 1 +654ms[ +654ms] +/- 37ms
2.配置ssh免密登陆,能够实现客户端主机通过服务器端的redhat账户进行基于公钥验证方式的远程连接
第一步定位node1制作公钥和私钥
[root@node1 ~]# 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:TLz00O1pdhckH4edRFIfTTnzIpmWFbf7ShSL4YNftV4 root@node1
The key's randomart image is:
+---[RSA 3072]----+
| o=%B|
| . . . B*O|
| = . o=.+*|
| + + +*+.+=|
| S o.O.=+E|
| + =..o|
| . ...|
| . . |
| . |
+----[SHA256]-----+
第二步定位node1,上传公钥
[root@node1 ~]# ssh-copy-id root@192.168.48.129
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/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:行183: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_tmp_id: 没有那个文件或目录
/usr/bin/ssh-copy-id:行189: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
grep: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
/usr/bin/ssh-copy-id:行202: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_output: 没有那个文件或目录
cat: /root/.ssh/ssh-copy-id.tsd8BK9bIw/popids_tmp_id: 没有那个文件或目录
/usr/bin/ssh-copy-id: WARNING: All keys were skipped because they already exist on the remote system.
(if you think this is a mistake, you may want to use -f option)