|
|||||||||
| 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 |
| Tags |
| aix, unix |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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
|
||||
|
||||
|
If you have "sudo", add that for the users. Or make it setuid.
|
| Sponsored Links | ||
|
|
|
#3
|
||||
|
||||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
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
|
||||
|
||||
|
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 | ||
|
|
![]() |
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 |
|
|