ubuntu同步网络时间

连网从ubuntu服务器上同步时间
sudo ntpdate ntp.ubuntu.com或是 sudo ntpdate cn.pool.ntp.org
sudo ntpdate time.nist.gov

设置电脑的时区为上海
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

这时候用date命令查看当前时间就是正确的时间,但是需要要当前时间写入CMOS

使用sudo hwclock --systohc就可以将系统时间写入CMOS了。重启之后,系统时间就是正确的
了。

posted on 2012-10-18 11:11  风林幻海  阅读(209)  评论(0编辑  收藏  举报

导航