change user id from 200 to 202


 
Thread Tools Search this Thread
Operating Systems AIX change user id from 200 to 202
# 1  
Old 03-29-2008
change user id from 200 to 202

Hi AIX Experts,

i need your help in this issue,
i want to change user id of xyz user from 200 to 202
note that this xyz user owner for many files and directories

so my issue how to change the user id from 200 to 202 and the files still under his ownership

this is an urgent work , please help.

thanks
Sherif
# 2  
Old 03-29-2008
hmm... give that, at the time you change the UID on the user (usermod -u 202 xyz) the UID on the files will no longer belongs to a valid user, this should allow you to use find with the -uid flag, in order to search for all the files owned by UID=200, this result you can parse through xargs demanding a chown xyz on the files, which in theory should provide you with the desired change on your system.

How ever, be aware the user in question should not be loged in on your system at the time of the change.
# 3  
Old 03-29-2008
Dear Redhead,
Could you please give script for this steps
because i don't know how to do that
thanks
sherif
# 4  
Old 03-29-2008
# usermod -u 202 xyz

Can be executed anywhere, now user xyz has a UID of 202, leaving every file owned by user xyz marked as owned by UID 200 instead of user xyz.

# chown xyz `find / -uid 200`
Can be executed from anywhere, it will search from the root finding any file owned by UID 200, which was the users previus userID, effectively changing it back to user xyz which by this time has UID 202.
# 5  
Old 04-01-2008
Quote:
Originally Posted by redhead
# chown xyz `find / -uid 200`

This might or might not work, depending on the number of files found that way. The following will work regardless of how many files there are:

Code:
find / -uid 200 -exec chown <username>:<usergroup> {} \;

I hope this helps.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. AIX

How to change normal user id to LDAP user id?

If I create a new user id test: mkuser id=400 test then I want it to LDAP user: chuser -R LDAP SYSTEM=LDAP registry=LDAP test It shows: 3004-687 User "test" does not exist. How to do? (4 Replies)
Discussion started by: rainbow_bean
4 Replies

2. Solaris

Solaris 10 310-202 Question

Hello All, Below I'm posting a question regarding a possible Solaris 10 310-202 exam question that I think is wrong. I do not agree that the answer is B. The inetadm command does not even have a flag/option of -a. Can anyone provide any assistance? Thanks! You've tried connecting to... (2 Replies)
Discussion started by: VeeDub78
2 Replies

3. UNIX for Dummies Questions & Answers

change user> to user@host> ssh prompt

Hi, I was wondering how to change the prompt for my ssh login. At the moment it is like user> while I'd like it to be as user@host> It is in the .bash_profile or .ssh ??? Thanks (2 Replies)
Discussion started by: pmasterkim
2 Replies

4. Homework & Coursework Questions

310-202 question

Hi guys, i need help : The system admin wants to configure user_attr(4)sources in the /etc/nsswitch.conf Which line needs to be configured? a: passwd b: user_attr The answer is A but wait !! I did a man nsswitch.conf and user_attr is a valid database ( at least for soalris 10) ,... (0 Replies)
Discussion started by: binary0011
0 Replies

5. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies
Login or Register to Ask a Question