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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reusing UID

Status
Not open for further replies.
Mar 14, 2001
48
US
I came across the below statemnt from the SA-1(solaris 8) docs frIf you must reuse a UID, “wipe the slate clean” so the new user is not affected by attributes set for a former user. How can I do this
 
I'm not totally sure by "attributes set for a former user."

If you set up a user with an old UID and the old user still has files on the system, the new user will get ownership of those files. Maybe that is what it is referring to.

One thing, I would think, is to make sure the old user's home directory is deleted or ownership of the directory assigned to someone else.

Also (and this might be what the docs are referring to), you should do a find on the entire system before you set up the new user, to make sure all the old user's files are either deleted or assigned to someone else.

If you haven't deleted the old user yet, the way to get a list of all files owned by the user is, as root at root:

find / -user <old user's login name> >> /tmp/olduserfiles.txt

This will give you a list of files the old user had and will allow you to either delete them or reassign them.

If you already have deleted the old user, try this:

find / -nouser >> /tmp/nouser.txt

This will give you a list of all files that belong to someone who doesn't have an entry in the /etc/passwd file. You may get a long list that includes files that you have downloaded (like patches). You can then delete or reassign ownership of the old user's files as required.

There may be an easier way to do this, but it has worked for me.


 
seems a good way to me, you might want to add a -local to the predicate list though, so that it doesn't search mounted file systems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top