System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

change user ID in the passwd file in HPUX

 
Dharmendra Patel
Occasional Visitor

change user ID in the passwd file in HPUX

Hi
I changed myself as a root user by assigning myself with user ID 0. I would like to change myself back to a normal user. What user ID should I change it to and will it create any problems with the root user.
11 REPLIES

Re: change user ID in the passwd file in HPUX

Whatever ID you would have used for the next user.

There shouldn't be any problems with root, provided you don't try a mass chown of all of the files that belong to root.
You'll need to assign a group and home directory.
Johnson Punniyalingam
Honored Contributor

Re: change user ID in the passwd file in HPUX

>>I would like to change myself back to a normal user<<

so you need to edit /etc/passwd file

before that backup the /etc/passwd file

# cp -p /etc/passwd /etc/passwd.org
# vi /etc/passwd

Change your number to 6001 (some thing which doesn't exist in referring to /etc/passwd )

>>should I change it to and will it create any problems with the root user.<<

It will not creat problem aslong as you did only changed the ID, you're fine


HTH,

Johnson

Problems are common to all, but attitude makes the difference
Dharmendra Patel
Occasional Visitor

Re: change user ID in the passwd file in HPUX

When I use usermod -u 20 -o to change back to as a normal user I get the following

"Login is currently in use"

I restarted the HPUX server and tried to change the login mode but got the same error.

Johnson Punniyalingam
Honored Contributor

Re: change user ID in the passwd file in HPUX

>>"Login is currently in use"<<

I assume, you need to login root user not sudo/su if you stand on your userid and than su - root "you will get this error" or if you have any pervious login session open.

ps -ef |grep -i

kill that sessions which you user id holding.

or

better you vi /etc/passwd
Problems are common to all, but attitude makes the difference
TTr
Honored Contributor

Re: change user ID in the passwd file in HPUX

> "Login is currently in use"

That's probably because the username is the same as the root user and the username appears to the OS as in use.

You have to use "vipw" and edit the password file. Change the UID back to the original one (or a new UID) and the same with the primary group ID, GID. Ensure that the home directory is adjusted to the original home directory and user and group ownership of the home directory are set to those of the new UID/GID.
Dharmendra Patel
Occasional Visitor

Re: change user ID in the passwd file in HPUX

I have changed the passwd file but I still have root processes under my name. How can I resolve this.

ps -ef | grep -i

result

root 20265 5473 0 13:08:51 pts/tB 0:00 grep -i

Have a third party program called logmon. From here I can see many root processes still assigned to my login.

Should I restart the HPUX to get reslove this?

Re: change user ID in the passwd file in HPUX

>I have changed the passwd file but I still have root processes under my name. How can I resolve this.

Why do you care? Either they will eventually finish or you can kill them.

>Should I restart HP-UX to get resolve this?

Is it worth it?
Johnson Punniyalingam
Honored Contributor

Re: change user ID in the passwd file in HPUX

>>I have changed the passwd file but I still have root processes under my name. How can I resolve this.<<

Well done,

so I d'not have point why do you still do

ps -ef |grep -i ??????

No Need, taking reboot its useless.

You assign points close thread
Problems are common to all, but attitude makes the difference
Suraj K Sankari
Honored Contributor

Re: change user ID in the passwd file in HPUX

Hi,
>>Should I restart the HPUX to get reslove this?

No need to reboot the box when u logout form your system it will not there.

Suarj
Dharmendra Patel
Occasional Visitor

Re: change user ID in the passwd file in HPUX

Thank you all for your feedback
TTr
Honored Contributor

Re: change user ID in the passwd file in HPUX

This is how you say thank you in the forum
http://forums11.itrc.hp.com/service/forums/helptips.do?#33