Score:0

How do you prevent openvpn clients from changing the system clock?

cn flag

I'm using state based routing using iptables and a single user on a shared machine sometimes uses a VPN to get resources not available in our physical location. However, this is very annoying because, even though only one user is using the VPN, it still changes the system clock for the whole machine which makes it so APT doesn't work as well as other oddities.

Reading package lists... Done                                                                      
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 3h 41min 34s). Updates for this repository will not be applied.
E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 5h 44min 0s). Updates for this repository will not be applied.
W: https://apt.sonarr.tv/ubuntu/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: Release file for http://us.archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 1h 24min 36s). Updates for this repository will not be applied.

Date as run from the shared machine:

Tue Jun 20 12:31:34 PM MDT 2023

Date as run from a machine that has the correct time:

Tue Jun 20 06:32:06 PM MDT 2023

Is there a parameter that I need to add to my openvpn client to not change my system clock?

muru avatar
us flag
I find it unlikely that _OpenVPN_ is changing the time of anything. There's a 6-hour gap there, which coincidentally is also the difference between MDT and UTC. Is this shared machine a dual boot with Windows, and the system clock set to local time instead of UTC?
cn flag
Unfortunately not. It's a headless Ubuntu server. I've also turned off the openvpn service and the time corrects it's self.
muru avatar
us flag
Are you using ntp or chrony for time synchronization? Does the VPN have a post-connect script which might be running commands that change the time?
cn flag
What's strange here is that the timezone didn't change. So, you might be onto something.
cn flag
I've gone through the scripts setting up the split tunnel as well as the standard openvpn scripts and I can't find anything that is updating the timezone.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.