Unable to change uid to 0


 
Thread Tools Search this Thread
Operating Systems AIX Unable to change uid to 0
# 1  
Old 05-22-2014
Debian Unable to change uid to 0

Hi Friends,

I have created a new user "admin". I would like to use it as root equivalent (can change root password). Now, I want to give uid=0 and gid=0 to act as root. can you help? usermod command is not updating uid.

Code:
/etc/passwd:
root:!:0:0::/:/usr/bin/ksh
admin:!:221:207::/iscp/user/admin:/bin/ksh

using:
Code:
 usermod -u 0 -g 0 admin
3004-692 Error changing "id" to "0" : Account exists.

Thanks,
Suresh

Last edited by vbe; 05-22-2014 at 10:04 AM..
# 2  
Old 05-22-2014
Hi,

a short answer: Using the same UID for more than one user is not possible respectively not allowed.

If you need a user with root-privileges, please look for tools like SUDO or RBAC.

Regards
# 3  
Old 05-22-2014
Quote:
Originally Posted by -=XrAy=-
a short answer: Using the same UID for more than one user is not possible respectively not allowed.
Sorry to correct you, but it possible and allowed as well. In fact we have the same (IMHO silly, but it wasn't my decision) system in effect at the company i work for right now.

You simply edit "/etc/passwd" directly, using any text editor and set the user-ID there. A "root" user (with the special rights available to this account) is "root" because it has UID 0, not the other way round. Therefore, as soon as any user has UID 0, it is considered to be root(-equivalent), regardless of its name.

I hope this helps.

bakunin
# 4  
Old 05-23-2014
Hi Bakunin,

It is my requirement and we have around 300+ servers so it is very difficult to edit passwd file in all servers. Any command line tool / command is available?

Thanks
Suresh
# 5  
Old 05-23-2014
Quote:
Originally Posted by suresh3566
It is my requirement and we have around 300+ servers so it is very difficult to edit passwd file in all servers. Any command line tool / command is available?
You can use "sed" to edit the file, you do not have to do it manually. To distribute the command you have several options, but none of them "out of the box", without having to set up the procedure:

1) Use ssh-keys to establish passwordless root-login between certain servers (usually one centralized admin-server which is allowed to connect to any other servers). Then use a simple loop to remote-execute the command on a list of servers. This is about as close to the "distributed shell" from the PSSP/Cluster1600 middleware suites as it gets.

2) If you have a centralized HMC you could use this to execute commands as "root" on a list of LPARs.

3) Some centralized monitoring software (for instance HP/OpenView) run local agents on every machine monitored which can be used as a vehicle to execute arbitrary scripts.

I hope this helps.

bakunin
# 6  
Old 05-23-2014
I don't see the problem here. If you can execute the command:
Code:
usermod -g 0 -u 0 admin

on 300+ servers; why can't you execute the command:
Code:
ed -s /etc/passwd <<-"EOF"
	/^\(admin:[^:]*:\)[0-9]*:[0-9]*:/s//\10:0:/
	w
	q
EOF

on those same 300+ servers?
# 7  
Old 05-26-2014
Thank You Dan. It is working....Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Unable to change memory

Hello All, So it goes like this... I logged in to the HMC console , trying to change the memory of LPAR from 20 to 25 GB . It says that "your profile is configured to use maximum of only 20 GB" and not able to increase the memory. I created a new profile and filled "maximum memory " field... (4 Replies)
Discussion started by: gull05
4 Replies

2. HP-UX

Unable to change password

I need to change password of a non-root user on HPUX. Due to some local policy, it is not allowing me to do so. I need to keep same (previous) password, as that is application user. Can I bypass policy for this time, for this user somehow ? I am root on this machine. # uname -a HP-UX thprnv02... (3 Replies)
Discussion started by: solaris_1977
3 Replies

3. Solaris

Unable to change the passwd

bash-3.00# passwd sami New Password: Re-enter new Password: Dec 14 00:07:43 hack passwd: passwdutil: crypt_gensalt Invalid argument passwd: Unexpected failure. Password database unchanged. Permission denied i got this error while i am change the user(sami) passwd. (3 Replies)
Discussion started by: samiulla
3 Replies

4. UNIX for Dummies Questions & Answers

uid ,gid value change

Present /home/dsadm# id dsadm uid=0(root) gid=0(root) ---------------------------------- needs to be /home/dsadm> id dsadm uid=23186(dsadm) gid=16284(gdstage) Please provide the command/steps for the above uid, gid value change Thanks in advance for all your support . ... (3 Replies)
Discussion started by: sridhardwh
3 Replies

5. UNIX for Advanced & Expert Users

unable to change the root password?

I tried to change the root password. but it shows the following error. passwd: Authentication token manipulation error passwd: password unchanged If I login as a normal user that time I'm able to change my (user) password. If I login as a ROOT then I'm not able to change the password root... (6 Replies)
Discussion started by: ungalnanban
6 Replies

6. UNIX for Dummies Questions & Answers

Unable To Change a User's Password

I am trying to change a user's Password, but I get the error "Password Cannot be changed; see account Administrator". Yet I am logged in as root. I also cannot access the Accounts Manager facility when SCO when using System Administration screen Error "Unable to get initial list of users" (2 Replies)
Discussion started by: Waitstejo
2 Replies

7. HP-UX

Unable to change root password

Hi, Some how my root password expired for my hp_ux 10.20 machine and when i tried to change the password it displays file system full error how to resolve this issue At first it accepts newpassword and while saving it some where the problem is..... I am logging as root ........ ... (4 Replies)
Discussion started by: jagan_kalluri
4 Replies

8. Shell Programming and Scripting

NIS User UID Change

Hi All, I need to change the UID numbers of many NIS users, is there any command to modify the UID in NIS maps ? ( like usermod) so that their file permissions will be same even with their new UID. If not, how to check all the files owned by particular user in a computer and change the... (1 Reply)
Discussion started by: RAA
1 Replies

9. SCO

unable to change password

I have forgotten password of the system.I am having SCO Unixware 2.1.2.I am trying to change the password of the system by booting it with boot floopy.I edited the shadow file and made the password field blank.But I am not able to login.When I try to change the password of root or any id using... (1 Reply)
Discussion started by: girish_shukla
1 Replies

10. AIX

UID Change

Currently, I have about 7 servers and the uid for a given person is different on each server. I want to make the uid's the same for a given username on each server. I know how to change the uid via smit, but when I do the previous uid number shows up as the owner for the files of that username.... (4 Replies)
Discussion started by: mcateriny
4 Replies
Login or Register to Ask a Question