Operating System - HP-UX
1752301 Members
4892 Online
108786 Solutions
New Discussion юеВ

Re: changing UID of user sshd tftp and hpsmh

 
SOLVED
Go to solution
Ahmed_58
Regular Advisor

changing UID of user sshd tftp and hpsmh

Hi,
we upgrade the server to OS 11.23 and noticed the UID which was assign to other users now takin by "sshd" "tftp" and "hpsmh" users which are been created by OS. Can I change those UID?
14 REPLIES 14
Kapil Jha
Honored Contributor

Re: changing UID of user sshd tftp and hpsmh

you upgraded from 11.11 or 11.00,
anyways you can change the ids, just shutdown the subjected services and change the ID and restart the service.

check passwd again for any duplicate UID.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Ahmed_58
Regular Advisor

Re: changing UID of user sshd tftp and hpsmh

are you sure will not cause any problem, as some files belong to hpsmh already assign as owner

example below
drwxr-x--- 2 hpsmh hpsmh 96 Nov 11 14:08 logs
drwxr-xr-x 3 hpsmh hpsmh 96 Nov 11 14:08 session
dr-xr-x--- 2 root hpsmh 96 Nov 11 14:08 sslshare
drwxr-x--- 2 hpsmh hpsmh 96 Nov 11 13:23 tmp
Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

>are you sure will not cause any problem, as some files belong to hpsmh already assign as owner

That's why you change your existing users and not the reserved system UIDs.
Ahmed_58
Regular Advisor

Re: changing UID of user sshd tftp and hpsmh

will my existing user must use the sam UID as it is our DR and must match the production.
Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

>as it is our DR and must match the production.

You may have to schedule some time to change them.
James R. Ferguson
Acclaimed Contributor
Solution

Re: changing UID of user sshd tftp and hpsmh

Hi:

Unfortunately, HP-UX has long considered "user" UIDs to begin at 100 leading to the annoying conditions you describe.

You can change the UID of an account by editing '/etc/passwd' (using 'vipw' to be safe) and then changing the ownership of the directories and files that belong to the *old* UID to the new UID. You might want to first create a file of the old UID like this (by example):

# find / -user 100 -print > /tmp/olduid_100

Then, for example, if you were changing UID 100 to UID 200, edit '/etc/passwd' to change UID 100 to UID 200 and do:

while read NAME
do
chown 200 ${NAME}
done < /tmp/olduid_100

As noted, you may need to schedule some downtime if there are active processes (daemons, etc) associated with the changing UID.

Regards!

...JRF...


Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

>JRF: while read NAME; do chown 200 ${NAME}

If you want performance, you should use xargs:
xargs -tn80 chown 200 ${NAME} < /tmp/olduid_100

Kapil Jha
Honored Contributor

Re: changing UID of user sshd tftp and hpsmh

usermod is the command which would do it seemlessly.

#usermod -u new_id user

man usermod

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Kapil Jha
Honored Contributor

Re: changing UID of user sshd tftp and hpsmh

plus you do not need to do any chown

BR,
Kapil+
I am in this small bowl, I wane see the real world......