GagA// 0n D nEt

It is currently Tue Aug 21, 2018 10:16 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Linux: Find files without any owner/group
PostPosted: Sun Sep 27, 2009 10:08 pm 
Offline

Joined: Wed Jul 18, 2007 1:14 am
Posts: 181
As a part of security audit you want to find the files which aren't being owned by any user. In such case you can use the find command to look for such files.

The following command will list the files which aren't being owned by any user:
Quote:
[[email protected] ~]# find / -nouser

Similarly you can find the files which does not belong to any group:
Quote:
[[email protected] ~]# find / -nogroup

So take for example, we have a user(s) leaving the organization and we delete the user with recursive option (userdel -r USERNAME), it will delete the home directory and it's contents. However, it won't delete the files being owned by that user in other folders.

In such case we can use the following command to identify such files:
Quote:
[[email protected] ~]# find / -nouser -nogroup

So depending on the requirement, we can either delete those files or change the ownership (user & group) for such files.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group