Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
I require disabling all attempts of a Fedora user to modify system time.
I am thinking of disabling writing to RTC after the OS boots up; that way, no separate hacks per application will be needed.
Is that a sensible solution? If yes, what could be the cleanest implementation for this?
There are two clocks, the system clock and the RTC or hardware clock. The RTC basically keeps time while the computer is off and at start up the OS will read the hardware clock to set the system clock. Both the gnome-applet and ntpdate change the system clock.
Just wanting a piece of guidance; I am actually wanting that no user should be able to change the time. One obvious solution is to prevent giving "sudo" previleges to the user. However, I am wondering, if a lower-level solution is possible?
Doing
Code:
sudo chmod 0555 /dev/rtc0
would prevent writing to the RTC; how can one do the same for system clock?
I tried searching code for "hwclock" in "systemd" package (Fedora distro), in order to find the "keeper" of system-time; however, I find nothing there, except ::
Code:
[ajay@ajay systemd-10]$ grep -r -i -s "hwclock" .
./Makefile.in: units/hwclock-load.service units/hwclock-save.service \
./Makefile.in: units/hwclock-load.service units/hwclock-save.service \
./Makefile.am: units/hwclock-load.service \
./Makefile.am: units/hwclock-save.service \
./units/hwclock-load.service:ExecStart=/sbin/hwclock --systz
./units/hwclock-load.service:# Note the weird semantics if hwclock and the kernel here: the first
./units/hwclock-save.service:ExecStart=/sbin/hwclock --systohc
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.