April 24th, 2013, 11:29 PM
Suid permission and passwd command
I'm using Ubuntu 12.04 and learning about linux commands. So I'm going through the Ubuntu Unleashed 2012 edition book and I come across a passage under a section titled: "Understanding Set User ID and Set Group ID Permissions"
So I a bit confused because the command points to the /usr/bin directory but the passages states that the changes are made to /etc/passwd. Could someone clarify what I'm missing here.
April 25th, 2013, 01:08 AM
The program is /usr/bin/passwd. What it does is make changes to a file named /etc/passwd.
April 25th, 2013, 07:13 AM
What requnix says!
What the setgid and setuid 'bits' of permissions do is let someone run a program s if they had the permission/access level of the group or owner of the program. And yes, that IS dangerous, which is why it should be used with care.
In this example (of the passwd program) the setuid 'bit' is set (the s in the rxs of the owner permissions) which means that anyone who can run the program will effectively run it with the access rights of the owner. That is needed here as the /etc/passwd file is protected against update by only allowing the root user to do so.
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
Appreciate that clarification. Unfortunately, I had to create a new account cause I had trouble resetting my password for OkComputer24. Thanx a lot though.