Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User ID has changed, what I should care about 1

Status
Not open for further replies.

MoreFeo

Technical User
Nov 29, 2002
547
ES
Hi, I must start managing a new Solaris server (new to me, it's already installed and running), and I've seen that someone messed up with user ids.

With ps -ef, I see some processes (IAS) not showing the user name, but showing instead some kind of user id:
Code:
# ps -ef
...
 [b]0001009[/b]  5597  5522   0   Dec 21 ?           0:20 /ias/ias10gr3/Apache/Apache/bin/httpd -d /ias/ias10gr3/Apache/Apache -DSSL
 0001009 22628  5522   0   Feb 14 ?           0:52 /ias/ias10gr3/Apache/Apache/bin/httpd -d /ias/ias10gr3/Apache/Apache -DSSL
 0001009  6746     1   0   Feb 04 ?         110:27 /ias/ias10g/jdk/bin/java -server -Djava.security.policy=/ias/ias10g/j2ee/oc4j_g
...
 0001010  2154     1   0   Dec 21 ?           0:00 /ias/ias902/opmn/bin/opmn -ds
 0001010  2156  2154   0   Dec 21 ?          70:12 /ias/ias902/opmn/bin/opmn -ds
0001009   523     1   0   Feb 08 ?          60:34 /ias/ias10g/jdk/bin/java -server -Djava.security.policy=/ias/ias10g/j2ee/oc4j_f
 0001010  3566  3544   0   Dec 21 ?           1:47 /ias/ias902/Apache/Apache/bin/httpd -d /ias/ias902/Apache/Apache -DSSL -f /ias/
...

If I look into /etc/passwd, I see that these user ids no longer belong to any user, but instead of it I see IAS users, but with different IDs:
Code:
...
ias902:x:[b]60003[/b]:101::/export/home/ias902:/bin/ksh
ias10g:x:60005:101::/export/home/ias10g:/bin/ksh
ias1022:x:60004:101::/export/home/ias1022:/bin/ksh

...

So, someone has changed these user IDs, and has also changed the owner of their home directories:
Code:
# cd /export/home
# ls -l
total 10
...
drwxr-xr-x   2 [b]ias10g[/b]   dba          512 Jun 19  2007 ias10g
drwxr-xr-x   2 ias902   dba          512 May 17  2007 ias902
...

But hasn't changed the app directories:
Code:
# cd /
# ls -l | grep ias
drwxrwxr-x  10 [b]1009[/b]     dba          512 Sep 20  2007 ias
# ls -l ias
total 34
drwxr-xr-x  51 1006     dba         1024 Jun 29  2007 ias1022
drwx------  66 [b]1009[/b]     dba         1536 Oct 24 18:25 ias10g
drwx------  57 1009     dba         1024 Sep  3  2007 ias10gr3
drwxr-xr-x  72 1010     dba         1536 Sep 20  2007 ias902
drwxrwxr-x   4 1006     dba          512 Jul  5  2007 jre
drwx------   2 1009     dba         8192 Jun 19  2007 lost+found
drwxrwxr-x  17 1006     dba          512 Sep 20  2007 oraInventory
drwxrwxr-x   6 1010     dba          512 Jul  5  2007 oui

So now I need to go and chmod all these directories, to match once again users ias902, ias10g and ias1022.

What are the things I should care about?
What are the steps you'll recommend me to follow?

Thanks.
 
Excuse me, I said chmod but I meant chown.

What I'm planning to do is:
1. Identify and match old IDs with user names (1006 --> user ias1022, 1009 --> user ias10g and 1010 --> user ias902)

2. Verify the owner of files and subdirectories in /ias, to make sure all the files/directories under /ias/ias1022 belong to ias1022, under /ias/ias10g belong to ias10g, etc...

3. For each /ias subdirectory:
Code:
chown -R -h <user> <directory>
This in case all the files under a directory belong to same user.

4. Change owner of /ias

Is there anything more you would worry about?

Thanks.
 
I would save a ls -lR listing or tarball of the old perms.

I think I would use "find DIR -uid OLDUID -exec chown..."
to only change that have the missing uid OLDUIR.
 
I'll have a look at your suggestion.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top