User Tools

Site Tools


networking:linux:linux_time

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:linux:linux_time [2012/02/17 08:45]
gcooper
networking:linux:linux_time [2021/01/16 21:15] (current)
gcooper
Line 5: Line 5:
  
 ntpq -p ntpq -p
- 
-ntptrace pool.ntp.org 
  
 ntpstat ntpstat
  
-cat /var/log/daemon.log|grep ntp+grep ntp /var/log/messages 
 +</file>
  
-zcat /var/log/daemon.log.1.gz |grep ntp+===== Ubuntu ===== 
 + 
 +https://linuxconfig.org/how-to-change-timezone-on-ubuntu-18-04-bionic-beaver-linux 
 + 
 +https://feeding.cloud.geek.nz/posts/time-synchronization-with-ntp-and-systemd/ 
 + 
 +:!: ''systemd-timesyncd'' is a client-only, lightweight, simple, replacement for ''ntpd'' It cannot act as a time server. 
 + 
 +<file> 
 +timedatectl set-timezone America/Phoenix 
 + 
 +timedatectl status 
 +</file> 
 + 
 +<file> 
 +systemctl restart systemd-timesyncd.service
 </file> </file>
  
Line 19: Line 33:
 Here we: Here we:
  
-  Set the correct timezone +  Set the correct timezone 
-  Set the actual time +  Set the actual time 
-  Set the NTP daemon to automatically start on system boot +  Set the NTP daemon to automatically start on system boot 
-  Start the NTP daemon+  Start the NTP daemon 
 +  - Verify the NTP daemon is working properly
  
 <file> <file>
Line 32: Line 47:
  
 chkconfig ntpd on chkconfig ntpd on
-service start ntpd+service ntpd start
  
 tail /var/log/messages tail /var/log/messages
Line 43: Line 58:
 <file> <file>
 cat /var/log/ntpd/current |tai64nlocal cat /var/log/ntpd/current |tai64nlocal
 +</file>
 +
 +===== Ubuntu =====
 +
 +<file>
 +sudo apt-get install ntp
 +
 +sudo service ntp restart
 </file> </file>
  
Line 50: Line 73:
  
 Edit /etc/ntp.conf and add a line for your preferred server: Edit /etc/ntp.conf and add a line for your preferred server:
-<file> 
  
 +<file>
 vi /etc/ntp.conf vi /etc/ntp.conf
  
Line 70: Line 93:
 ===== NTP Servers ===== ===== NTP Servers =====
  
 +<file>
 0.us.pool.ntp.org  0.us.pool.ntp.org 
 1.us.pool.ntp.org 1.us.pool.ntp.org
 2.us.pool.ntp.org 2.us.pool.ntp.org
 3.us.pool.ntp.org 3.us.pool.ntp.org
 +</file>
  
 ===== Local Network Server ===== ===== Local Network Server =====
Line 80: Line 105:
  
 <file> <file>
-vim /etc/ntp.conf +vim /etc/ntp.conf
  
 # Hosts on local network are less restricted. # Hosts on local network are less restricted.
Line 87: Line 112:
 </file> </file>
  
 +<file>
 sudo service ntpd restart sudo service ntpd restart
 +</file>
 +
 +===== Public Server =====
 +
 +https://www.digitalocean.com/community/tutorials/how-to-configure-ntp-for-use-in-the-ntp-pool-project-on-ubuntu-16-04
  
 ===== Firewall ===== ===== Firewall =====
networking/linux/linux_time.1329493512.txt.gz · Last modified: 2012/02/17 08:45 by gcooper