Unix/Linux Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

learn linux and unix commands - unix shell scripting

etc/passwd

AIX


Tags
aix, unix

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-13-2009   -   Original Discussion by daveisme
daveisme's Unix or Linux Image
daveisme daveisme is offline
Registered User
 
Join Date: Jul 2007
Last Activity: 15 May 2014, 2:42 PM EDT
Posts: 71
Thanks: 2
Thanked 0 Times in 0 Posts
etc/passwd

Is there any way to allow users to access the etc/passwd file for commands like whoami but not be able to read the file? If I don't put a user in the security group and change the permissions on the etc/passwd file to 640 (rw-r-----) the users can login but the whoami command doesn't work for them. If I give other the read permission whoami works but the user can also read the file. I want user to be able to run the whoami command but not see what is in the /etc/passwd file.
Sponsored Links
    #2  
Old Unix and Linux 11-13-2009   -   Original Discussion by daveisme
TonyLawrence's Unix or Linux Image
TonyLawrence TonyLawrence is offline
Registered User
 
Join Date: Sep 2007
Last Activity: 1 April 2010, 2:17 PM EDT
Location: SE Mass
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
If you have "sudo", add that for the users. Or make it setuid.
Sponsored Links
    #3  
Old Unix and Linux 11-14-2009   -   Original Discussion by daveisme
syndex's Unix or Linux Image
syndex syndex is offline
Registered User
 
Join Date: Jun 2007
Last Activity: 6 January 2011, 11:22 PM EST
Location: Pennsylvania
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
I would suggest setting up sudo for whoami. If you want to make it completely transparent set up sudo, so the user doesn't need to type in a password and then create an alias that does 'sudo whoami'.
    #4  
Old Unix and Linux 11-17-2009   -   Original Discussion by daveisme
garethr's Unix or Linux Image
garethr garethr is offline
Registered User
 
Join Date: May 2009
Last Activity: 17 April 2012, 11:28 AM EDT
Location: England
Posts: 97
Thanks: 0
Thanked 2 Times in 1 Post
You can't make /etc/passwd unreadable, because commands like "ls" rely on it to associate numeric uids to usernames.

If you make /etc/passwd unreadable to a user, then whenever that user types "ls -l", or certain other commands, they will just see numbers instead of usernames as the file owners.
Sponsored Links
    #5  
Old Unix and Linux 12-06-2009   -   Original Discussion by daveisme
pchangba's Unix or Linux Image
pchangba pchangba is offline
Registered User
 
Join Date: Sep 2008
Last Activity: 11 December 2009, 1:24 AM EST
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Read the detail of SUID bit .....and be very careful for using it.
It might cause the security risks. but i think it can solve your problem.
Sponsored Links
    #6  
Old Unix and Linux 12-06-2009   -   Original Discussion by daveisme
frank_rizzo's Unix or Linux Image
frank_rizzo frank_rizzo is offline Forum Advisor  
Resident BOFH
 
Join Date: Dec 2007
Last Activity: 28 July 2016, 2:18 PM EDT
Posts: 1,152
Thanks: 4
Thanked 92 Times in 89 Posts
not sure what your trying to do but I highly recommend NOT altering the permissions on /etc/passwd. Your not improving security by doing this and will break something. /etc/security/passwd which contains encrypted passwords is already protected.
Sponsored Links
Closed


Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
cut -d: -f4 /etc/passwd | more wickbc Solaris 3 11-08-2007 03:16 PM
AIX 5.1 to AIX 5.2 /etc/passwd gefa AIX 1 03-31-2005 01:56 AM
no /etc/passwd cyno UNIX for Advanced & Expert Users 3 11-03-2003 04:19 PM
etc/passwd nguda UNIX for Dummies Questions & Answers 2 07-03-2003 10:38 AM
passwd Erwin Stocker UNIX for Advanced & Expert Users 5 10-09-2002 07:33 AM



All times are GMT -4. The time now is 09:49 PM.