February 2020
Intermediate to advanced
666 pages
15h 45m
English
When a regular file has its SUID permission set, whoever accesses the file will have the same privileges as the user of the file.
To demo this, let's say that Maggie, a regular, unprivileged user, wants to change her own password. Since it's her own password, she would just use the one-word passwd command, without using sudo:
[maggie@localhost ~]$ passwdChanging password for user maggie.Changing password for maggie.(current) UNIX password:New password:Retype new password:passwd: all authentication tokens updated successfully.[maggie@localhost ~]$
To change a password, a person has to make changes to the /etc/shadow file. On my CentOS machine, the shadow file's permissions look like this:
[donnie@localhost ...