LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-04-2011, 05:54 AM   #1
XXLRay
Member
 
Registered: May 2010
Posts: 133

Rep: Reputation: 16
What happens to files if owner is deleted


I want to delete a user but need to keep the data he created. What happens to the files of a user e.g. in a project folder used by multiple user when he is deleted. Are the files deleted to or are they automatically assigned to a new user?
 
Old 07-04-2011, 06:00 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
The files will be preserved and will retain the user ID of the owner. Suppose user john has uID 501 and gID 100 = users, after deletion of user john you will see:
Code:
-rw-r--r--  1 tom users     3342 Jun 13 09:47 file1
-rw-r--r--  1 501 users     5072 Jun 13 09:47 file2
The only things that will be deleted (unless you decide to keep them) are the user's home directory and the user's mailbox.
 
1 members found this post helpful.
Old 07-04-2011, 06:00 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Best method would be to chown the files to another user before deleting that user.
To your question, the files will not be deleted. Although the user is deleted the files will still belong to that users UID.
 
1 members found this post helpful.
Old 07-04-2011, 06:06 AM   #4
XXLRay
Member
 
Registered: May 2010
Posts: 133

Original Poster
Rep: Reputation: 16
Thank you. That was all I needed to know.
 
Old 07-04-2011, 04:51 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
The group or root will or should still have access.

Where the files are may be important. If you delete the user and the files on in the users home the files may be deleted.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] search files and directories' owner windstory Linux - Newbie 1 06-04-2011 12:18 AM
permissions: how to have files always have the same owner/mod? browny_amiga Linux - Software 3 10-09-2010 01:57 PM
deny rm permission for non-owner of files AndrewBS42 Linux - Security 3 10-03-2007 01:53 AM
problem with owner of files bikov_k Linux - General 5 11-09-2006 03:03 PM
Change Owner on many files how to? linchat Linux - General 2 02-23-2006 04:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration