how passwd bypasses permisssion for /etc/shadow in linux

Status
Not open for further replies.

sknowonweb

Journeyman
Hello every one,
My instructor throw me a question in linux.
As a normal user one cannot append or edit something in /etc/passwd or /etc/shadow files as they have 400 permision code.But for a normal user the usage of passwd(1) command changes his password which means that this edits the /etc/shadow files password field entry.How and what is passwd(1) doing when it cannot have even read permission for /etc/shadow.

Please bare me im a newbie.and help me solve this.
 

__Virus__

Ambassador of Buzz
:according to my thought:

When a user changes his password from say think-digit from digit-think, the OS does recognize that the user has permission to edit part of the file and without user intervention the file will be edited. Remember the user must the permission to change his password.
 

praka123

left this forum longback
I think it has to do something with PAM(pluggable--) i saw a file /etc/pam.d/passwd..perhaps i need to study about pam .... :D also should examine SUID and SGID...
 

ujjwal

Padawan
Code:
$ ls -l /usr/bin/passwd
-rws--x--x  1 root bin 37880 2004-06-22 00:50 /usr/bin/passwd*

As you can see, the program passwd runs with suid, and therefore runs with root priviledges. Check this for more info -

*www.linuxgeek.net/index.pl/suid
 
Status
Not open for further replies.
Top Bottom