0

I try to set date:

sudo date -s "28 OCT 2018 15:00:00"

but before I need to disable NTP

timedatectl set-ntp false

Google Cloud Container-Optimized OS doesn't have timedatectl util

-bash: timedatectl: command not found

But which util is return my set up time to ntp time ? How to set other date via ssh in Google Cloud Container-Optimized OS ? Pls help!

0

3 Answers 3

2

The default time zone of Container-Optimized OS is UTC0. Create a symbolic link to your desired time zone as in the following example: check official docs Changing the time zone

sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime
0

You can disable NTP with

sudo systemctl stop ntp 
sudo systemctl disable ntp

Expected output:

ntp.service is not a native service, redirecting to systemd-sysv-install Executing /lib/systemd/systemd-sysv-install disable ntp

To check:

systemctl is-enabled ntp

Expected output:

ntp.service is not a native service, redirecting to systemd-sysv-install Executing /lib/systemd/systemd-sysv-install is-enabled ntp disabled

By default, the NTP server is pointing to either metadata.google or metadata.google.internal in order to get the correct time. After disabling NTP, you can just change the date or time with

sudo date
0

write for stop the servive by a moment.

service ntpd stop

for permanent stop:

service ntpd disable

Regards

You must log in to answer this question.