Operating System - HP-UX
1836365 Members
1998 Online
110100 Solutions
New Discussion

Re: Home Directory Ownership Changed

 
M.sureshkumar
Regular Advisor

Home Directory Ownership Changed

Hi,
In our plant,10.20 o.s is running in k-class server.there are two directories in /home,i.e cad and cad1 dir's,cad for cad users home dir's and cad1 for cad1 users home dir's.suppose i can add new user in cad or cad1 then file ownership for cad or cad1 home dir,s changed to new user ID.suppose i can delete any user then file ownership for cad or cad1 dir's changed to some numbers.how it is possible to take any other user ID or it takes random number for total home dir's.This problem comes at user add or use del condtion.
3 REPLIES 3
Naveej.K.A
Honored Contributor

Re: Home Directory Ownership Changed

When you delete a user and don't delete the files owned by the user, this random number appears..

This is not a random number but the UID of the user who owns the file, which you have just deleted. When you do a ls -l to get the information about the file, it gets the owner of the file from the inode where file information is stored and then checks /etc/passwd to get the information about the user. But as you have deleted the user, no information is available and hence the UID is displayed

With best wishes
Naveej
practice makes a man perfect!!!
Sanjiv Sharma_1
Honored Contributor

Re: Home Directory Ownership Changed

Hi Suresh,

When you don't delete the files owned by the user you have just deleted then a random number UID is given for the owner of these files.

Incase you don't need the files owned by those users then you can delete them as well or you can give the ownership of those to some otheruser.
Everything is possible
SS_6
Valued Contributor

Re: Home Directory Ownership Changed

You already got the explanation for ownership. If you wish to delete the user as well as its home directory than use
userdel -r username and it will delete its home directory also or you can reallocate same home directory to some other user.
By providing solutions I am helping myself