You are viewing a read-only archive of the Blogs.Harvard network. Learn more.
Skip to content

sudo can break if you sync your system clock time on Ubuntu

Well I got hit by this bug and it’s really annoying. On reboot of a
Linux box I’m working with I noticed the system clock was majorly skewed.
Since I wasn’t running anything really critical, I decided to update the time
via ntpdate so all the system clock would ‘right’ itself out. Then I get
the following when I try to sudo


$ sudo ls
sudo: timestamp too far in the future:

Wonderful. If you don’t already have ‘root’ access in Ubuntu you can’t
sudo to get to root so you’re stuck. If your clock was running too fast
and you synced it back to the right time it should be possible to wait until
the ‘right’ time if it’s not too unreasonable a wait. OR if you have
root you can do this:


# rm -r /var/run/sudo/

This clears out the cache for your userid that sudo keeps so you can sudo again.
Yet another example of something that looks well in a secure sense can
cause weird breakage way way down the line.

A helpful
forum thread about this problem in Ubuntu

Be Sociable, Share!