The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-11-2008
Registered User
 

Join Date: Aug 2008
Posts: 9
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
Reply With Quote
Forum Sponsor
  #2  
Old 08-11-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Google for "setuid". If this is homework, your teacher probably already told you about this mechanism.
Reply With Quote
  #3  
Old 08-11-2008
Registered User
 

Join Date: Mar 2006
Posts: 143
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
As you can see from the owner's (i.e. root) perm bits instead of the usual x
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0