this post was submitted on 17 Apr 2026
57 points (100.0% liked)

Linux

14731 readers
249 users here now

A community for everything relating to the GNU/Linux operating system (except the memes!)

Also, check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] thurstylark@lemmy.today 14 points 4 months ago* (last edited 4 months ago)

The answer to the text of the question is: that would continue to work. sudo doesn't re-auth while a child process is still running, which in this case is su. Until su terminates, sudo doesn't have anything to say about it. To be a bit more precise, the time limit for reauth would expire, but sudo doesn't ask for authorization, and therefore wouldn't check if that timeout has elapsed, until the next invocation.

To answer the spirit of the question: you should probably be using sudo -i instead.