Equivalent uid to root | Unix Linux Forums | AIX

  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.

Equivalent uid to root

AIX


Tags
aix, unix

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-15-2013
abohmeed abohmeed is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 8 April 2014, 10:04 AM EDT
Posts: 38
Thanks: 14
Thanked 3 Times in 3 Posts
Equivalent uid to root

Hi all
I have a strange problem on one my my AIX machines. We have created a user called testroot with the same UID as root (uid=0) by changing the uid of that user in the /etc/passwd file. I know that this is a security breach but this is a test system.
Now the strange thing that happens is that when i run

Code:
su -

to get the root prompt and then run
Code:
id

the command says that the id of the current user is testroot and NOT root, although having a uid of 0.
Strange enough, when i try to do some root tasks with that user like changing the password of another user on a HACMP cluster i am faced with an error message that only root can do this.
To my surprise, now even if i log on to the system with username root and the root password and run
Code:
id

it says that i am logged in as testroot!
Of course the only solution to this problem was to change the uid of that user to something else to regain my root privileges.
But still this is a very weird problem. Does anybody have a clue why this behavior occurs?
Thanks a lot in advance
Sponsored Links
    #2  
Old 01-15-2013
Scott's Avatar
Scott Scott is online now Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 1 October 2014, 4:04 AM EDT
Location: Zürich
Posts: 8,483
Thanks: 332
Thanked 1,047 Times in 914 Posts
It should depend on the order the users are in the passwd file.


Code:
# head -2 /etc/passwd
root:x:0:0:root:/root:/bin/bash
postgres:x:0:4003:Postgres owner:/home/postgres:/bin/bash
 
# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk)
 
(change order in passwd file...)
 
# head -2 /etc/passwd
postgres:x:0:4003:Postgres owner:/home/postgres:/bin/bash
root:x:0:0:root:/root:/bin/bash
 
# su -
# id
uid=0(postgres) gid=4003(postgres) groups=4003(postgres)

Sponsored Links
    #3  
Old 01-15-2013
abohmeed abohmeed is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 8 April 2014, 10:04 AM EDT
Posts: 38
Thanks: 14
Thanked 3 Times in 3 Posts
Thanks Scott.. I've already checked that. Actually the first entry in the passwd file is root and testroot is way near the end of the file.
    #4  
Old 01-15-2013
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
 
Join Date: May 2005
Last Activity: 1 October 2014, 3:10 AM EDT
Location: In the leftmost byte of /dev/kmem
Posts: 4,267
Thanks: 45
Thanked 820 Times in 647 Posts
The user accounting in AIX is a bit more complicated than you seem to assume: there is not only "/etc/passwd" but also "/etc/security/passwd", similar for groups. In addition some information might be stored in the ODM. You have to change these files and make sure their contents match somehow, otherwise inconsistencies can be expected.

Without complete information i am left to guesses, but first i would check this and make sure the user database is consistent with itself.

The problem about "only root can do that" is probably caused by sloppy programming: usually the system uses numeric UIDs and these are only translated to names via consulting "/etc/passwd" for human convenience (quite like IP addresses are translated via "/etc/passwd"). Some utility might, instead of sticking to this convention, use user names instead of IDs though.

I hope this helps.

bakunin
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
New root account with Different UID number johnavery50 Solaris 2 08-13-2012 07:47 AM
Migration of system having UFS root FS with zones root to ZFS root FS sb200 Solaris 2 06-27-2012 02:35 PM
Setuid Program with (-rwsr-sr-x 1 root other ) UID/EUID issue 0ktalmagik UNIX for Advanced & Expert Users 7 08-20-2006 12:16 AM
Run non-root script as root with non-root environment bubba112557 UNIX for Dummies Questions & Answers 2 12-02-2004 11:39 PM
Hw to create root-equivalent accounts? penguin-friend UNIX for Advanced & Expert Users 6 01-28-2002 04:40 AM



All times are GMT -4. The time now is 04:11 AM.