The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > 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
change wc -l francis_tom Shell Programming and Scripting 1 04-14-2008 10:02 AM
change 43% to 43.5 nortypig Shell Programming and Scripting 2 08-20-2006 12:55 AM
IP change kuultak UNIX for Dummies Questions & Answers 2 07-13-2005 06:01 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-03-2003
Registered User
 

Join Date: Oct 2003
Location: Roseville, CA
Posts: 8
UID Change

Currently, I have about 7 servers and the uid for a given person is different on each server. I want to make the uid's the same for a given username on each server. I know how to change the uid via smit, but when I do the previous uid number shows up as the owner for the files of that username. Does anyone have any idea how I can also change the uid at the file level? For example:

Before changing the uid...
-rw------- 1 username staff 3726 Oct 03 13:10 testfile

After changing the uid... There are thousands of files where the uid does not change.
-rw------- 1 211 staff 3726 Oct 03 13:10 testfile

Instead of uid of 211 I want to see the username.

Suggestions are greatly appreciated.
Mario
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-03-2003
pressy's Avatar
solaris cultist
 

Join Date: Aug 2003
Location: Vienna / Austria (Europe) [EARTH]
Posts: 713
i'm not the aix guru, but in solaris when you see digits as an owner, the userid isn't defined in /etc/passwd....

if i have more than one maschine with the same users, i alway make one maschine first and copy these files to the other maschines:
/etc/passwd
/etc/shadow
/etc/group
so i have the same users with the same id everywhere......

greetings Preßy
Reply With Quote
  #3 (permalink)  
Old 10-03-2003
Registered User
 

Join Date: Oct 2003
Location: Roseville, CA
Posts: 8
Hello Preßy,

Thank you for your reply. I am aware of the files you mentioned and the uid has changed in these files. But, the issue I am facing is that the username on the files owned by the user where I changed the uid is replaced by the previous uid number.

I quess what I am hoping for is that someone has a scripts to go through the directories to locate all files that has the old uid and chown it with the user's new uid. If not, I may have to write my own script to do this.

Thanks again,
Mario
Reply With Quote
  #4 (permalink)  
Old 10-03-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,452
First, you may have a special problem...did the user have a crontab? Or pending at jobs? Ideally you want to remove these before you make the change. And then resubmit them after the change. At this point I would manually remove them, kill and restart cron and then resubmit them.

To change the uids on the files use:

find / -user 211 -print | xargs chown username
Reply With Quote
  #5 (permalink)  
Old 10-06-2003
Registered User
 

Join Date: Oct 2003
Location: Roseville, CA
Posts: 8
Thank you!

Perderabo,

I would like to thank you for your solution to my problem. This is exactly what I needed. I tested it and it works great!

Thank you,
Mario
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0