rdate
Set system date and time from server
SYNOPSIS
rdate [-pLs] host ...
PARAMETERS
host
The hostname or IP address of the remote machine from which to retrieve the date and time.
-p
Print the date and time obtained from the remote host to standard output, but do not set the local system's clock. This option is useful for testing connectivity or viewing the remote time without modifying the system.
-s
Set the date and time on the local system using the time retrieved from the remote host. This is typically the default behavior if no other action-modifying options like -p are specified and a host is provided. Setting the system clock usually requires root privileges.
-L
Use a local TCP port number of 1023 or less when connecting to the remote host. This option is sometimes necessary when communicating with older Time Protocol servers that enforce connections originating from privileged ports. Using this option requires root privileges to bind to a low-numbered port.
DESCRIPTION
The rdate command is a utility used to retrieve the current date and time from a specified remote network host and set the local system's clock accordingly. It primarily utilizes the Time Protocol (RFC 868) over TCP port 37. While historically useful for basic time synchronization, it is now largely considered a legacy tool. Modern systems prefer NTP (Network Time Protocol) based solutions (like ntpdate, ntpd, or chrony) for their superior accuracy, robustness, and advanced features such as handling leap seconds, stratum information, and cryptographic authentication. rdate's simplicity means it lacks these sophisticated capabilities, making it less suitable for critical time synchronization in contemporary networked environments.
CAVEATS
Security: rdate uses the insecure RFC 868 Time Protocol, which offers no authentication or encryption. This makes it vulnerable to man-in-the-middle attacks, where a malicious actor could provide an incorrect time.
Accuracy: It is less accurate than NTP. It does not account for network latency in a sophisticated manner, nor does it handle leap seconds or provide stratum information, which are crucial for precise timekeeping.
Privileges: Setting the system time and using the -L option typically require root privileges.
Deprecation: It has been largely superseded by NTP clients (ntpdate, ntpd, chrony) for robust, secure, and accurate time synchronization.
Firewall: Requires TCP port 37 to be open on both the client and the server for communication.
TIME PROTOCOL (RFC 868)
The Time Protocol, defined in RFC 868, is a very simple network protocol that rdate relies upon. A server implementing this protocol listens on TCP port 37 and, upon receiving a connection, sends a 32-bit unsigned integer representing the number of seconds since January 1, 1900, 00:00 UT. It then closes the connection. This protocol's simplicity means it does not account for network latency, leap seconds, or provide any authentication or error correction, which are significant limitations compared to modern time synchronization protocols like NTP.
HISTORY
rdate has been a part of Unix-like systems for many decades, implementing the simple RFC 868 Time Protocol which was published in May 1983. Its early existence predates the widespread adoption and sophistication of NTP (Network Time Protocol), whose initial RFCs (RFC 958 in 1985, RFC 1305 in 1992) introduced much more advanced time synchronization capabilities. Due to its straightforward nature, rdate served as a basic utility for time synchronization in early network environments. However, as network security and the demand for highly accurate timekeeping grew, NTP-based solutions became the industry standard, effectively rendering rdate obsolete for most production use cases today.
SEE ALSO
date(1), ntpdate(8), ntpd(8), chronyd(8), timedatectl(1)