linux同步时间

1.安装ntp

# yum install ntp

wget http://mirrors.163.com/centos/5/os/i386/CentOS/ntp-4.2.2p1-15.el5.centos.i386.rpm

rpm -ivh ntp-4.2.2p1-15.el5.centos.i386.rpm

2.立即更新时间

sudo /sbin/ntpdate time.nist.gov

3.每天定时更新时间

sudo vi /etc/crontab

0 * * * * /sbin/ntpdate time.nist.gov

相关推荐