Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I have two systems. So, is there any way by which I can set the exact time in the second system as the one on the first system?
Thanks in advance
In case you have one linux system then you can configure it is NTP server. Now send a request from another system to the server to sync time.
...which won't work, since the first system won't be an authoritative time source, and therefore be untrusted as one, so the NTP request will fail. Unless you have SOME accurate time reference, the best you can hope for is to get close. The servers won't sync.
The main problem is that a system without a good clock (none have a decent clock) will drift. The difference between a good clock and a bad is the drift. A good clock will still drift... but in a consistent direction. Bad clocks (the usual kind) drift up... then drift down. Sometimes dependent on temperature, other times on power fluctuations (sometimes both).
If the two systems need to be very close then change the NTP query time... shorter times will keep the two systems much closer togethter.
The main problem is that a system without a good clock (none have a decent clock) will drift. The difference between a good clock and a bad is the drift. A good clock will still drift... but in a consistent direction. Bad clocks (the usual kind) drift up... then drift down. Sometimes dependent on temperature, other times on power fluctuations (sometimes both).
If the two systems need to be very close then change the NTP query time... shorter times will keep the two systems much closer togethter.
I have NEVER been able to get NTP to keep step without an accurate clock somewhere. Systems have ALWAYS drifted too much to be trusted. And given that NTP is a stateless UDP protocol, allowing port 123 through a firewall to connect to a well-known time source on the net doesn't present much of a risk. Even doing it for ONE tiny VM machine that does nothing BUT act as an internal clock buys you a lot.
To me, it's pointless to NOT have an accurate internal time server. Between the large internet time pools and being able to use a $30 GPS receiver into a USB port (which gets you a stratum 1 clock, with NO firewall ports opened at all), there's no reason not to.
I have NEVER been able to get NTP to keep step without an accurate clock somewhere.
It all depends on the definition of "accurate clock". If the system is defined to be "accurate" for the network (which may not be connected to the internet), then just shortening the client interval for updates will keep it "close enough".
Quote:
Systems have ALWAYS drifted too much to be trusted. And given that NTP is a stateless UDP protocol, allowing port 123 through a firewall to connect to a well-known time source on the net doesn't present much of a risk. Even doing it for ONE tiny VM machine that does nothing BUT act as an internal clock buys you a lot.
To me, it's pointless to NOT have an accurate internal time server. Between the large internet time pools and being able to use a $30 GPS receiver into a USB port (which gets you a stratum 1 clock, with NO firewall ports opened at all), there's no reason not to.
It all depends on what is being checked against. A stand alone local network is fine using a system for reference - accuracy will not be within a microsecond... but then nothing is. It is usually sufficient to be within 1 second, and within 16 milliseconds is rather easy to obtain. All it means is that the clocks on the given network are in sync.
They don't HAVE to be in sync with the rest of the world.
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166
Rep:
TB0ne,
I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues.
second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues.
second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
No need for access to the internet. It is usually cheaper to use a GPS receiver with a built-in NTP server. The GPS signals already include a very high clock resolution. The NTP server side just provides that time. They usually can also provide the location, but most places disable this feature.
Simpler on your security too as no network connection is required.
I am using this scenario to sync date of my network appliances like PCs and Servers. As This is local network, I don't care it is accurate or not but but when I check logs I must have same time on server and client. This will help me to troubleshoot issues. second case, if none of the PCs or server have internet access or I dont want that all PC go on internet for NTP and still I want to sync accurate time. In this case I should have Local NTP server which sync time from internet server and All other network devices sync their time with local NTP server. That will help to control Internet Traffic.
As said before, you DO NOT have to put ANY of your devices on the Internet. You set up ONE system on your internal network that DOES have NTP, and have all your devices point to IT. NOTHING leaves your internal network, if you use a GPS receiver. If you're concerned about security (which you must NOT be, since you don't want accurate time...since if you don't have that, you can't accurately collate events between your internal network and external events), you have many options. You bring up one little box...an old desktop PC is MORE than you need, and have it be your NTP server. Either have it reference the Internet clock pools (easy, accurate, and secure), or use a GPS. Then tell everything on your internal network to point to IT for the time. Done.
Quote:
Originally Posted by jpollard
No need for access to the internet. It is usually cheaper to use a GPS receiver with a built-in NTP server. The GPS signals already include a very high clock resolution. The NTP server side just provides that time. They usually can also provide the location, but most places disable this feature.
Simpler on your security too as no network connection is required.
Exactly. I usually go the GPS route, but you don't NEED the receiver to have a built-in NTP server. Just a cheap USB GPS receiver can easily be set up to be queried by NTP, using the NMEA data, and provides a stratum 1 clock...with 0 being atomic-clock. That's why I think (given the many options), it's a bad thing to NOT have a decent time reference.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.