Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 28979  / 1 Year ago, sat, december 17, 2022, 6:48:32

As far as I know and it seems that other people have the same opinion sudo is a command that executes something with administrative privileges.



However when I run rcconf I can see this line:



[*] sudo    Provide limited super user privileges to specific users


So what the point with this service? Or is this even a service?


More From » sudo

 Answers
0

Short answer



To revoke the 'cached' authentication actions of users on reboot. It's not a daemon, just a script run at boot time.






Extensive answer



By inspecting the init file /etc/init.d/sudo that 'starts the service', you can easily see what it's doing:



case "$1" in
start)
# make sure privileges don't persist across reboots
if [ -d /var/lib/sudo ]
then
find /var/lib/sudo -exec touch -t 198501010000 '{}' ;
fi
;;
stop|reload|restart|force-reload)
;;
*)
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac


So, basically, it just touches some files in /var/lib/sudo on start of the system to have it a very old modification timestamp. As a result, the 'cached' granted authentication actions are revoked on the start of the service (which happens at boot).



Some more detail on the /var/lib/sudo directory and those time stamps, please? Well, from the mapage of sudo(8):



[...]
Once a user has been authenticated, a time stamp is updated and the
user may then use sudo without a password for a short period of time
(15 minutes unless overridden in sudoers).
[...]
Since time stamp files live in the file system, they can outlive a
user's login session. As a result, a user may be able to login, run a
command with sudo after authenticating, logout, login again, and run
sudo without authenticating so long as the time stamp file's
modification time is within 15 minutes (or whatever the timeout is set
to in sudoers).
[...]
/var/lib/sudo Directory containing time stamps

[#33730] Sunday, December 18, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nuehan

Total Points: 253
Total Questions: 109
Total Answers: 120

Location: Singapore
Member since Sat, Jul 25, 2020
4 Years ago
nuehan questions
Sun, Dec 18, 22, 17:34, 1 Year ago
Mon, Mar 28, 22, 00:10, 2 Years ago
Fri, Jun 24, 22, 11:39, 2 Years ago
Thu, Apr 28, 22, 20:54, 2 Years ago
Fri, Aug 20, 21, 01:06, 3 Years ago
;