Create another root account


 
Thread Tools Search this Thread
Operating Systems AIX Create another root account
# 1  
Old 10-23-2014
Create another root account

Hi
I would like to create another root account, for example root2. I added a new user named root2 and set it's uid and gid ( in /etc/passwd ) to 0. Then I logged in ( account root2 ) and the server asked to change the password, so I changed.

And the problem happend. The password of both root and root2 changed. I had to log in ( root ) by new password, and everytimes I logged in ( root2 ) , the server asked to change password again. That also means I couldn't use account root2.

Someone know to to fix this, please SmilieSmilieSmilie

Thank you
# 2  
Old 10-23-2014
Ok,
So you manually edited the /etc/passwd file.
Lesson no.1 You never do that.

Now, coming to your problem, after you change the password for root2, is it letting you in to the system?

Do you have sudo setup for sysadmin users? if so, login as that user then sudo to root (NOT root2). Edit the /etc/passwd file and remove the entry for root2.
Change the root password and make sure that you have not exceed the defined unsuccessfult_login_count.

If this don't work I can provide you another solution. 1st try this and let us know.

I hope this helps.
This User Gave Thanks to ibmtech For This Post:
# 3  
Old 10-24-2014
Hi,

I suggest not to do that.. you can use rbac(for AIX 6.1), create your roles and assing roles to other users. They have same authotity as root and it's safer thinking in security stuff.
Suppose you create a role myadminrole and assigned to a user israel, so log
1- log on as israel
2- swrole myadminrole
and do what ever you want.
This user can change the root password without any issues.

Hopes this helps
This User Gave Thanks to igalvarez For This Post:
# 4  
Old 10-25-2014
Quote:
Originally Posted by ibmtech
Ok,
So you manually edited the /etc/passwd file.
Lesson no.1 You never do that.

Now, coming to your problem, after you change the password for root2, is it letting you in to the system?

Do you have sudo setup for sysadmin users? if so, login as that user then sudo to root (NOT root2). Edit the /etc/passwd file and remove the entry for root2.
Change the root password and make sure that you have not exceed the defined unsuccessfult_login_count.

If this don't work I can provide you another solution. 1st try this and let us know.

I hope this helps.
I counldn't log in as root2 because when I loged in as root2, the server always asked to change password, I changed password and then I was disconnected. I loged in 2nd times and the server asked again, and then again ...

I could log in as root normally, but with root2's password

If I remove the entry for root2, account root2 will not exist anymore ???
# 5  
Old 10-25-2014
root2 never really existed at all -- that's kind of the problem. They were never independent the way you wanted and can't be, the UID prevents it. If you remove root2's line from /etc/passwd, it will just be /root again. Ordinarily I would never suggest editing /etc/passwd but you you did so in the first place, creating a situation the usual tools may not be equipped to handle.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 10-25-2014
Also, since you've changed the UID of root2 to the one of root, it changed the password of 'root' since that was the 'right' uid.
root2 didnt get the password update, since it has another original uid.

To avoid such disasters, i'd suggest to use these tools (as root obviously, and with care):
  • useradd
  • userdel
  • usermod
  • groupadd
  • groupdel
  • groupmod

Read their respective --help output.
Or go GUI either way system-config-users.

Hope this helps
This User Gave Thanks to sea For This Post:
# 7  
Old 10-26-2014
Quote:
Originally Posted by sea
To avoid such disasters, i'd suggest to use these tools (as root obviously, and with care):
  • useradd
  • userdel
  • usermod
  • groupadd
  • groupdel
  • groupmod
I would suggest not to use these tools, but in fact i do not even have to - they do not exist in AIX systems, only in Linux systems. Please take the forum you are posting to into account.

Quote:
Originally Posted by sea
Read their respective --help output.
Or go GUI either way system-config-users.
Same here. AIX tools do not have any options introduced with a double dash "--" and system-config-users simply doesn't exist.

To the problem:

A UNIX system identifies users by their UID, which is a number. When the system displays a user name instead of the number (like "root" instead of "0") it is because it translated the number first using "/etc/passwd" as translating table. Entries there are used from top to bottom. You can easily test this: create two users, "a" and "b" and modify the "/etc/passwd" so that both have the same UID. Now create a file and give the ownership to one of these accounts. Do a ls -l and you will see the first of the two users in "/etc/passwd" as owner. Now edit "/etc/passwd" and make the other entry the first. A ls -l will now show the other user (the one now coming first) as the owner.

If you do not exactly know what to do you should use the mkuser utility to create users, which makes all the necessary entries in "/etc/passwd", "/etc/security/passwd", "/etc/limits", etc.. You can change the UID later for the created account by modifying "/etc/passwd". Notice, though, that the id command and similar tools relying on "/etc/passwd" will identify this account as "root", for reasons stated above.

I hope this helps.

bakunin

Last edited by bakunin; 10-26-2014 at 07:50 PM.. Reason: typo
These 3 Users Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Recover root account

Hi everyone! I've got a problem caused by another who did: - He create an user and grant the group (1) to this - The problem appears as "Permission deined when reboot the Server Dec 21 09:13:09 payment dtlogin: open_pam_conf: Owner of /etc/pam.conf is not root Dec 21... (4 Replies)
Discussion started by: trantuananh24hg
4 Replies

2. Solaris

how to su - from non root acount to non root account

HI i am trying to give su access to some users say X Y and Z to a account AB . I am able to give them su access to root with the help of sudoers file but i want to give them password less access to AB account which i am not able to do . I want to this when user X fires "su - AB" he is not... (9 Replies)
Discussion started by: rishiraaz
9 Replies

3. UNIX for Dummies Questions & Answers

Root account!

Is it possible to create more than one root account? Thanks, Jorge (4 Replies)
Discussion started by: jofonseca99
4 Replies

4. Solaris

Root account - disable expiry

I couldnt find this in any other post - so hoping someone can help out. I want to set password expiry (or rather I have to) for a number of users on my solaris 9 system. I know i can set the following options in the /etc/default/passwd file to do it and then just type a passwd -f <username> to... (6 Replies)
Discussion started by: frustrated1
6 Replies

5. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

6. UNIX for Advanced & Expert Users

Root account is expired

Hi all, I am using redhat linux version 9 .I am unable to login to the system and i am getting a warninig sorry root account is expired . How can i activate the account. (2 Replies)
Discussion started by: mallesh
2 Replies

7. Solaris

Renaming of root account

Hi, I have solaris 7. Just for implementing security on my system, I would like to know can I rename the root account to something else. After renaming will my os still function properly. Regards, (2 Replies)
Discussion started by: RajaRC
2 Replies

8. AIX

root account has been locked

I'am set the root account locked ON, using smitty, so I can't login or su with root user in my AIX system, some one can help me to unlock root account login ???, sample : :~>su root's Password: 3004-301 Your account has been locked; please see the system administrator. 3004-501 Cannot su to... (1 Reply)
Discussion started by: Maker
1 Replies

9. UNIX for Dummies Questions & Answers

create or modify user account to have same access as root

Is there a way to create or better yet modify a user account so it has the same privs as root? (6 Replies)
Discussion started by: xadamz23
6 Replies
Login or Register to Ask a Question