Size: 596
Comment:
|
← Revision 17 as of 2024-10-25 22:04:39 ⇥
Size: 2356
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
NTP is a TCP/IP protocol for synchronizing time over a network. | |
Line 4: | Line 5: |
== Update clock in Slackware with NTP == | == Slackware == === Update clock === |
Line 6: | Line 9: |
* ntpdate pool.ntp.org | {{{#!highlight sh ntpdate pool.ntp.org sudo ntpdate pool.ntp.org }}} |
Line 14: | Line 20: |
* chmod 755 /etc/rc.d/rc.ntpd | {{{#!highlight sh chmod 755 /etc/rc.d/rc.ntpd }}} |
Line 17: | Line 25: |
* /etc/rc.d/rc.ntpd start * /etc/rc.d/rc.ntpd status |
{{{#!highlight sh /etc/rc.d/rc.ntpd start /etc/rc.d/rc.ntpd status }}} |
Line 24: | Line 34: |
{{{#!highlight bash server 127.127.1.0 # local clock fudge 127.127.1.0 stratum 10 server pt.pool.ntp.org driftfile /etc/ntp/drift # Don't serve time or stats to anyone else by default (more secure) restrict default noquery nomodify # Trust ourselves. :-) restrict 127.0.0.1 }}} |
|
Line 25: | Line 45: |
Check the offset in milliseconds * ntpdate -q pt.pool.ntp.org * ntpq -pn |
Check the offset in seconds {{{#!highlight sh ntpdate -q pt.pool.ntp.org # offset in seconds ntpq -pn }}} == CentOS == {{{#!highlight sh yum install ntp service ntpd start chkconfig ntpd on service ntpd stop ntpdate pt.pool.ntp.org # sync clock service ntpd start ntpdate -q pt.pool.ntp.org ntpq -pn }}} == Ubuntu / Debian == {{{#!highlight sh apt-get install ntp ntpdate -q pt.pool.ntp.org service ntp stop ntpdate pt.pool.ntp.org service ntp start ntpq -pn # apt install -y ntp ntpsec-ntpdate ntpdate /sbin/ntpdate pt.pool.ntp.org /sbin/service ntp stop timedatectl set-timezone Europe/Lisbon /sbin/service ntp start }}} == FreeBSD 9.0 == Run the command: {{{#!highlight sh ntpdate pool.ntp.org }}} Check the UTC date: {{{#!highlight sh date -u }}} Edit the file '''/etc/rc.conf''': {{{#!highlight sh ntpd_enabled="YES" }}} Start and check the NTPD service status: {{{#!highlight sh /etc/rc.d/ntpd start /etc/rc.d/ntpd status }}} == Sync summer time Slackware == {{{#!highlight sh timeconfig # set HW clock to UTC /etc/rc.d/rc.ntpd stop ntpdate pt.pool.ntp.org /etc/rc.d/rc.ntpd start }}} == Windows == * net start w32time * w32tm /config /manualpeerlist:pt.pool.ntp.org * w32tm /resync /force |
NTP
NTP is a TCP/IP protocol for synchronizing time over a network.
Slackware
Update clock
Run the command as superuser:
Date and time should be stored in UTC.
Info on slack docs:
Enable the service:
1 chmod 755 /etc/rc.d/rc.ntpd
Start the service manually:
Add ntp server
- Edit /etc/ntp.conf
add server pt.pool.ntp.org
Check the offset in seconds
CentOS
Ubuntu / Debian
1 apt-get install ntp
2 ntpdate -q pt.pool.ntp.org
3 service ntp stop
4 ntpdate pt.pool.ntp.org
5 service ntp start
6 ntpq -pn
7 #
8 apt install -y ntp ntpsec-ntpdate ntpdate
9 /sbin/ntpdate pt.pool.ntp.org
10 /sbin/service ntp stop
11 timedatectl set-timezone Europe/Lisbon
12 /sbin/service ntp start
FreeBSD 9.0
Run the command:
1 ntpdate pool.ntp.org
Check the UTC date:
1 date -u
Edit the file /etc/rc.conf:
1 ntpd_enabled="YES"
Start and check the NTPD service status:
Sync summer time Slackware
Windows
- net start w32time
- w32tm /config /manualpeerlist:pt.pool.ntp.org
- w32tm /resync /force