![数字化系统安全加固技术](https://wfqqreader-1252317822.image.myqcloud.com/cover/844/52717844/b_52717844.jpg)
上QQ阅读APP看书,第一时间看更新
1.5.4 配置系统时间同步
风险分析 对于一个安全的系统来说,获取准确的时间是至关重要的,特别是对于一些和系统时间相关联的应用,比如Kerberos、NFS(Network File System,网络文件系统)等。
加固详情 配置系统时间同步。
加固步骤
(1)安装服务。
在系统中直接使用yum命令安装服务,依次执行以下命令。
yum install chrony yum install ntp
(2)配置chrony服务。
在文件/etc/chrony.conf中添加或者编辑参数server,形式如下。
server <remote-server>
在文件/etc/sysconfig/chronyd中添加或者编辑参数OPTIONS,添加-u chrony,形式如下。
OPTIONS="-u chrony"
配置完成信息如图1-14所示。
![](https://epubservercos.yuewen.com/4DF1B5/31310223203853406/epubprivate/OEBPS/Images/tx020.jpg?sign=1738840735-xTcL4ONlmyic9gdBM7MHcbesno0SHZ58-0-47e4e633aabce4a4bda34f10bb42d424)
图1-14 配置chrony服务
(3)配置ntp服务。
在文件/etc/ntp.conf中添加或者编辑以下内容。
restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery
在文件/etc/ntp.conf中添加或者编辑参数server,形式如下。
server <remote-server>
在文件/etc/sysconfig/ntpd中添加或者编辑参数OPTIONS,添加 -u ntp:ntp,形式如下。
OPTIONS="-u ntp:ntp"
配置完成信息如图1-15所示。
![](https://epubservercos.yuewen.com/4DF1B5/31310223203853406/epubprivate/OEBPS/Images/tx021.jpg?sign=1738840735-2exjjYKxibn848DBJgft6fcxeLN18PM8-0-e113a8222a8e8bed93621e9f4142105e)
图1-15 配置ntp服务
在系统执行以下命令,重启服务使配置生效。
systemctl daemon-reload systemctl --now enable ntpd