Skip to content

Instantly share code, notes, and snippets.

@nvidhub
Last active October 8, 2019 06:14
Show Gist options
  • Save nvidhub/0fd1efa19f6a5b4ab6308bbad70391b7 to your computer and use it in GitHub Desktop.
Save nvidhub/0fd1efa19f6a5b4ab6308bbad70391b7 to your computer and use it in GitHub Desktop.
服务器时间同步

部分服务器厂商为了所谓的这安全,屏蔽了NTP同步时间的服务。现在可以使用 rdate 来解决。

yum -y install rdate 
rdate -s time-b.nist.gov

cat > /etc/cron.daily/rdate << "EOF" 
#!/bin/sh 
rdate -s time-b.nist.gov 
/sbin/hwclock -w 
EOF

chmod +x /etc/cron.daily/rdate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment