LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how passwd(1) for normal user changes /etc/shadow? (https://www.linuxquestions.org/questions/linux-newbie-8/how-passwd-1-for-normal-user-changes-etc-shadow-395676/)

sknowonweb 12-22-2005 12:01 PM

how passwd(1) for normal user changes /etc/shadow?
 
Hello every one,
My instructor throw me a question.
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 file.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.

jtshaw 12-22-2005 12:06 PM

We really frown on answering homework questions here. However, I will help point you in the right direction.

ls -la /bin/passwd outputs:
Code:

-rws--x--x  1 root root 29992 Nov  7 08:29 /bin/passwd
The key here are the permissions "-rws--x--x" and the owner of the file "root". So lookup the linux permission model and it'll answer your question. Keep in mine the s in rws is not a typo.

I'd recommend reading the man page for chmod. In general, always start your research with the man pages...


All times are GMT -5. The time now is 01:59 PM.