Operating System - HP-UX
1752766 Members
5038 Online
108789 Solutions
New Discussion юеВ

Re: changing UID of user sshd tftp and hpsmh

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

>Kapil: plus you do not need to do any chown

It isn't documented that usermod(1m) performs the chown(1) operation, so I would assume it doesn't.
Kapil Jha
Honored Contributor

Re: changing UID of user sshd tftp and hpsmh

it does not change files outside user's home directory, but it does whatever inside home directory.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
James R. Ferguson
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

Hi (again):

> Dennis: If you want performance, you should use xargs

Yes, of course. In fact, we can eliminate the intermediate file and its attendant I/O and do:

# find / -user 100 -print|while read NAME;do echo ${NAME};done|xargs -t chown 200

As Dennis inferred, using the '-t' option with 'xargs' gives you a trace of the command and its arguments that are being executed.

Regards!

...JRF...

Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

>JRF: we can eliminate the intermediate file and its attendant I/O and do:

You may want that file for your records, or to do the chmod in chunks.

>using the '-t' option with 'xargs' gives you a trace of the command

Oops, that should have been -tn80 (or an even larger number).
Dennis Handly
Acclaimed Contributor

Re: changing UID of user sshd tftp and hpsmh

># find / -user 100 -print | while read NAME; do echo ${NAME}; done | xargs -t chown 200

 

Hmm.  If you eliminate the file, there is no need for that while and xargs:

fine / -user 100 -exec chown 200 {} +