The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do i change to super user then revert back to ordinary user ,using shell script? wrapster Shell Programming and Scripting 3 06-04-2008 08:11 AM
Change of user name SunBurntYux Forum Support Area for Unregistered Users & Account Problems 1 06-01-2008 10:12 AM
User name change? Jmt Post Here to Contact Site Administrators and Moderators 1 12-16-2007 04:38 PM
NIS User UID Change RAA Shell Programming and Scripting 1 05-06-2007 11:33 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-29-2008
sh_day1 sh_day1 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 2
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 (permalink)  
Old 03-29-2008
redhead's Avatar
redhead redhead is offline
Registered User
  
 

Join Date: Feb 2002
Location: Denmark
Posts: 68
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 (permalink)  
Old 03-29-2008
sh_day1 sh_day1 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 2
Dear Redhead,
Could you please give script for this steps
because i don't know how to do that
thanks
sherif
  #4 (permalink)  
Old 03-29-2008
redhead's Avatar
redhead redhead is offline
Registered User
  
 

Join Date: Feb 2002
Location: Denmark
Posts: 68
# 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 (permalink)  
Old 04-01-2008
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,631
Quote:
Originally Posted by redhead View Post
# 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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0