1、如何在Ubuntu和LinuxMint设置时间同步服务器
编辑 /etc/ntp.conf ,并更改以下缓冲池根据您的选择。默认情况下,这些服务器的配置:
刷新NTP服务器
在ntp.conf更改后,重新载入你的 ntp 服务
$ sudo service ntp reload
打开防火墙端口
NTP服务器使用端口123的服务请求。因此,我们需要在防火墙中打开123端口。
iptables的用户:
$ sudo iptables -A INPUT -m state --state NEW -p tcp --dport 123 -j ACCEPT
UFW用户:
$ sudo ufw allow 123/tcp
在客户端同步时间
使所有配置重启生效后,现在通过同步客户端系统验证服务器配置。例如,如果你的服务器的IP是192.168.1.100,然后通过客户端系统上运行的终端下面的命令。
$ ntpdate -s 192.168.1.100
2、linux怎样自动校正时间?
linux可以通过命令去取世界时间,命令格式如下ntpdate -s time.windows.com前提是需要该linux能够上网,需要自动更内新的话,加入系统计划任务容即可。按照你需要的每小时或者每分钟去校准即可。若在内网,你可以自己搭建一个时间服务器,有windows的,也有linux的。这里就不再说了。
3、系统时间错乱如何使用NTP进行系统时间调整
解决方法:
1. 创建一个文件/etc/cron.daily/timeupdate:
___FCKpd___0nbsp;sudo nano /etc/cron.daily/timeupdate
2. 输入以下内容:回
ntpdate ntp.ubuntu.com
3. 保存文件后,还需要赋予其可执行权答限:
___FCKpd___2nbsp;sudo chmod 755 /etc/cron.daily/timeupdate
这样,系统就可以每天获取时间(/etc/cron.daily/目录下的所有任务都会被每天执行一次),并校准服务器本身的时间。如果你担心时间获取失败,则可以将多个NTP服务器添加到/etc/cron.daily/timeupdate文件中:
ntpdate ntp.ubuntu.com pool.ntp.org
4、如何在ubuntu和linuxmint设置时间同步服务器
首先安装ntp service的安装包 安装完成后,运行ntp命令同步时间就可以了 ntp -d serverIP
5、如何在Ubuntu中使用NTP进行时间同步
修改注册表,提高时间同步精度
由于系统默认的时间同步间隔是7天,我们无法自由版选择,使得这个功能权在灵活性方面大打折扣。其实,我们也可以通过修改注册表来手动修改它的自动同步间隔以提高同步精度,以下以XP系统为例。
1. 在“开始”菜单→“运行”项下输入“Regedit”进入注册表编辑器
2. 展开[
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpClient
] 分支,并双击 SpecialPollInterval 键值,将对话框中的“基数栏”选择到“十进制”上
3.
对话框中显示的数字正是自动对时的间隔(以秒为单位),比如默认的604800就是由7(天)×24(时)×60(分)×60(秒)计算来的。设定时间同步周期(建议设为900=15分钟或3600=1小时等周期值),填入对话框,点击确定保存关闭对话框。
4.
在Parameters列表中,将NtpServer键值修改为NTP服务器的IP地址(1.cn.pool.ntp.org),然后点击“确定”按钮保存。
6、linux怎么添加ntp服务器
个人linux系统比如ubuntu、deepin等都已经安装了,只需要勾选同步网络时间即可。
如果是服务器可以参考:
[root@localhost /]# yum install ntp -y
2.修改NTP配置文件,添加NTP服务器的网络位置 /etc/ntp.conf
# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 192.168.1.1 iburst #目标服务器网络位置
#server 1.CentOS.pool.ntp.org iburst #一下三个是CentOS官方的NTP服务器,我们注释掉
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
#broadcast 192.168.1.255 autokey # broadcast server
#broadcastclient # broadcast client
#broadcast 224.0.1.1 autokey # multicast server
#multicastclient 224.0.1.1 # multicast client
#manycastserver 239.255.254.254 # manycast server
#manycastclient 239.255.254.254 autokey # manycast client
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography.
keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
# Disable the monitoring facility to prevent amplification attacks using ntpdc
# monlist command when default restrict does not include the noquery flag. See
# CVE-2013-5211 for more details.
# Note: Monitoring will not be disabled with the limited restriction flag.
disable monitor
保存退出
3.启动服务并设置开启自启
[root@localhost /]# systemctl start ntpd.service#启动服务
[root@localhost /]# systemctl enable ntpd.service#设置为开机启动
7、LINUX中,网络校时ntpdate用法
ntpdate简单用法:
# ntpdate ip
# ntpdate 210.72.145.44
以下是一些可用的NTP服务器地址:
Name
IP Location
210.72.145.44 210.72.145.44 中国(国家授时中心)
133.100.11.8 133.100.11.8 日本(福冈大学)
time-a.nist.gov 129.6.15.28 NIST,Gaithersburg,Maryland
time-b.nist.gov 129.6.15.29 NIST,Gaithersburg,Maryland
time-a.timefreq.bldrdoc.gov 132.163.4.101 NIST,Boulder,Colorado
time-b.timefreq.bldrdoc.gov 132.163.4.102 NIST,Boulder,Colorado
time-c.timefreq.bldrdoc.gov 132.163.4.103 NIST,Boulder,Colorado
utcnist.colorado.e 128.138.140.44 UniversityofColorado,Boulder
time.nist.gov 192.43.244.18 NCAR,Boulder,Colorado
time-nw.nist.gov 131.107.1.10 Microsoft,Redmond,Washington
nist1.symmetricom.com 69.25.96.13 Symmetricom,SanJose,California
nist1-dc.glassey.com 216.200.93.8 Abovenet,Virginia
nist1-ny.glassey.com 208.184.49.9 Abovenet,NewYorkCity
nist1-sj.glassey.com 207.126.98.204 Abovenet,SanJose,California
nist1.aol-ca.truetime.com 207.200.81.113 TrueTime,AOLfacility,Sunnyvale,California
nist1.aol-va.truetime.com 64.236.96.53 TrueTime,AOLfacility,Virginia
8、如何在ubuntu server 搭建ntp服务器
1、安装ntp软件
sudo apt-get install ntp
2、修改配置文件
sudo vim /etc/ntp.conf
driftfile /var/lib/ntp/ntp.drift
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
server ntp.ubuntu.com
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
restrict 192.168.10.0 mask 255.255.255.0 nomodify
restrict 127.0.0.1
restrict ::1
主要是在配置文件中的:
restrict -6 default kod notrap nomodify nopeer noquery
语句后面加入:
restrict 192.168.10.0 mask 255.255.255.0 nomodify
restrict 192.168.10.0 mask 255.255.255.0 nomodify---主要是允许能同步的服务器所在的内部网段
9、ubuntu系统如何与使用sntp协议的gps对时
几乎所有抄的Linux发行版本都有现成的,你找一下NTP相关的包,通常是ntpd之类的名字,装上,设定好htp服务器(所有的Linux发行版也都提供自己的ntp服务器),保证服务开启就好了。
ntp说白了是同步Unix时间,你说的北京时间用时区设定就好了,与ntp无关。可以参考下《Linux就该这么学》详细了解相关知识
10、用ubuntu桌面版做服务器吗
Ubuntu系统做服务器,不同的服务需要安装不同的软件,例如:WEb服务需要安装Apache,FTP服务需要安装VSFTP,时间服务需要安装NTP,下面以Ubuntu作为FTP服务器为例:
1.安装vsftpd
sudo apt-get install vsftpd
2.配置vsftpd
#修改vsftpd的配置文件。此类配置文件通常位于 /etc 目录下
sudo gedit /etc/vsftpd.conf
#配置文件中具体说明
listen=YES # 服务器监听
#anonymous_enable=YES # 匿名访问允许 很危险,默认不要开启,
local_enable=YES # 本地主机访问允许
write_enable=YES # 写允许
#anon_upload_enable=YES
# 匿名上传允许,默认是NO,嫌麻烦的可以开起来。出了问题我不负责~
#anon_mkdir_write_enable=YES # 匿名创建文件夹允许
dirmessage_enable=YES # 进入文件夹允许
xferlog_enable=YES # ftp 日志记录允许
connect_from_port_20=YES # 允许使用20号端口作为数据传送的端口
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem3.启动FTP服务sudo service vsftpd start