如何为 Samba4 配置 NTP 服务器

Samba4 没有NTP也能正常工作。
但是如果因为某个原因,导致服务器客户端之间的时间误差超过 5 分钟,则会导致组策略无法正常工作。
所以最好是配置好NTP 服务器。

如果服务器和客户端之间的时间间隔增加,则将无法正常工作。
所以总是建议我们在配置 Samba4 后安装

下面是在 Red Hat 或者 CentOS 中为 Samba4 配置 NTP 所需的基本步骤

在 RHEL 系统上,我们必须对 RHN 进行有效订阅,或者我们可以配置本地离线存储库,使用“yum”包管理器可以安装提供的 rpm 及其依赖项。

# yum -y install ntp
# vi /etc/ntp.conf
# comment out these lines
#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org
# Make sure these lines are present
server 127.127.1.1 # local clock
fudge 127.127.1.1 stratum 12
ntpsigndsocket /usr/local/samba/var/run/ntp_signd/
restrict default mssntp

完成后保存并退出并重新启动服务

# service ntpd restart

检查使用的服务器的 ntp

# ntpq -np

以“strace ntpd -n”的身份运行 NTP 守护进程将使 ntpd 保持在前台,并允许我们查看它打开和关闭的文件和套接字。

现在转到客户端机器并以管理员身份键入此命令

C:\> w32tm /resync

向本地计算机发送重新同步命令

日期:2020-06-02 22:16:48 来源:oir作者:oir