校准raspberry ip 时间的方法

1.date命令看当前时间对不对;

2.不对的话用命令校准一下  
sudo ntpd -s -d
3.还不行就手动设置时间
sudo date  --s="2016-09-1 12:00:00"
4.到第三步时间已经可以了。可以 添加一些国内可用的ntp服务器

打开ntp服务的配置文件

sudo nano /etc/ntp.conf

找到这两行

# You do need to talk to an NTP server or two (or three).
# server ntp.your-provider.example

在下面添加以下内容,是一些亲测可用的ntp服务器

第一行最后的perfer表示优先使用此服务器,也就是复旦大学的ntp服务器

添加之后按Ctrl+X保存退出

server ntp.fudan.edu.cn iburst perfer
server time.asia.apple.com iburst
server asia.pool.ntp.org iburst
server ntp.nict.jp iburst
server time.nist.gov iburst

重启ntp服务

sudo /etc/init.d/ntp restart

发布了35 篇原创文章 · 获赞 17 · 访问量 15万+

猜你喜欢

转载自blog.csdn.net/shaopengf/article/details/52412058
今日推荐