Live data from Hacker News

Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

twitter.com

71–74 of 74 posts

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#71
post #70
post #63

Earlier quoted context omitted.

> Changing back 01/01/1970 via Date & Time preferences doesn't need authentication This is not true but it can be confusing if you've authenticated at all recently due to a grace period like sudo's.

I've never unlocked that panel, and I've rebooted recently, and still didn't need authentication. Are you sure that's as right?

The authentication for changing things via the System Preferences system is independent of sudo and "sticks" across reboots.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#72
post #16

From the FreeBSD man for date Only the superuser may set the date, and if the system securelevel (see securelevel(7)) is greater than 1, the time may not be changed by more than 1 second. EDIT: so you need to be root anyway or have root access to change the date.

Users on MacOS can change the time without root access.

This is absolutely not true. You must be listed as an Administrator to change system time. If you're an Administrator, then your account is also included in the admin group which means you have full sudo access anyway.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#73
post #16

From the FreeBSD man for date Only the superuser may set the date, and if the system securelevel (see securelevel(7)) is greater than 1, the time may not be changed by more than 1 second. EDIT: so you need to be root anyway or have root access to change the date.

Users on MacOS can change the time without root access.

As far as I tested in the Date and Time preference pane,... Users enabled as an Administrator, yes. Standard users, no.

`date` still behaves as one expects.

Re: Run sudo -k, set your clock to 01.01.1970, run sudo su and boom you're root

#74
post #70
post #63

Earlier quoted context omitted.

> Changing back 01/01/1970 via Date & Time preferences doesn't need authentication This is not true but it can be confusing if you've authenticated at all recently due to a grace period like sudo's.

I've never unlocked that panel, and I've rebooted recently, and still didn't need authentication. Are you sure that's as right?

Is your account an Administrator account? Normal users are just Standard accounts and not Administrators.
Post reply on HN