![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| User permission | mr_bold | UNIX for Dummies Questions & Answers | 3 | 08-05-2008 04:34 AM |
| Looking for specific user ID's from the passwd file | LinuxRacr | Shell Programming and Scripting | 8 | 08-29-2007 12:37 AM |
| User should not be allowed to change passwd | brookingsd | UNIX for Dummies Questions & Answers | 3 | 01-23-2006 09:00 AM |
| Checking a file is not being written to | kanejm | Shell Programming and Scripting | 14 | 01-20-2006 05:29 AM |
| File being used/written | sanjay92 | UNIX for Dummies Questions & Answers | 4 | 10-13-2001 10:31 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How the /etc/passwd file is written when user does not have permission
Hi,
/etc/passwd file has write permission only for the root user. Now when a normal user changes the its own password using passwd command, how this information has been written to the /etc/passwd file when the user is not having write permission to this file. ~santosh |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Google for "setuid". If this is homework, your teacher probably already told you about this mechanism.
|
|
#3
|
|||
|
|||
|
Does this really smell like homework?
I would have taken it for a legitimate newbie question, especially since it was posted in the Dummies section. Have a look at the user interface's binary to change one's password which is the command passwd Code:
$ ls -l /usr/bin/passwd -rwsr-xr-x 1 root root 22960 Jul 17 2006 /usr/bin/passwd for execute there appears an s, the so called suid bit (that's what era referred to). This means that although most of the times executed by ordinary users, the command actually runs under the effective uid of root who is the only one on the system (normally) who is allowed to write to the file /etc/passwd. If you look at the perms of the ping command you will find another suid binary because ordinary users are not allowed to emit ICMP echo request packets. Because of the security implications those elevated privileges impose you generally will find only very few suid enabled executables on most Unix systems. And their number should be observed in e.g. security audits or when hardening a system. |
|||
| Google The UNIX and Linux Forums |