LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2010, 02:55 AM   #1
antcuenco
LQ Newbie
 
Registered: Aug 2010
Location: Singapore
Posts: 10

Rep: Reputation: 0
Question deleting system users


Hi guys,

Super newbie here, I am trying to delete this user from my system. But instead of using 'userdel -r user1' i forgot to add the '-r' and just keyed in 'userdel user1'. Then I noticed in the home directory that the user is still there, but is removed from the /etc/passwd directory. I tried using 'userdel -r user1' again, but system responds as 'user is deleted'. How to respond to this? as I want to delete that user?

And additionally, from the home directory. A colleague of mine, instead of creating a user using the 'useradd' command, he decided to just use 'mkdir user' at the home directory. Is it ok to use 'rmdir user' at the home directory? without causing any troubles to the system? I need advise, thank you so much..
 
Old 08-18-2010, 03:05 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
if you forget to use -r option it will just remove user account not home dir. in this case you need to remove home dir manually.
 
Old 08-18-2010, 03:10 AM   #3
antcuenco
LQ Newbie
 
Registered: Aug 2010
Location: Singapore
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by caseycolin View Post
I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here



Term Papers
Sorry about that, I am really new here, I'm still yet to adjust hehe got any ideas/tips for me? Really much appreciate it.
 
Old 08-18-2010, 03:12 AM   #4
antcuenco
LQ Newbie
 
Registered: Aug 2010
Location: Singapore
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sem007 View Post
if you forget to use -r option it will just remove user account not home dir. in this case you need to remove home dir manually.
Thanks for the advise. Can I just do a normal 'rmdir user' for this case?
 
Old 08-18-2010, 03:13 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
You seem to be confused about the difference between a user (actually a user account) as defined in /etc/password and files and directories.

You have already deleted the user, want you are trying to do is delete files that were owned by the user (in this case the users home directory and contents).

You can remove the users old home and files in it using the rm command.

Code:
rm -r /home/user1
However, you should probably also use the "-f" option otherwise you will have to confirm before rm goes into each subdir. Be warned that this will permanently remove these files, so be careful (I have even avoided typing it explicitly).

If you suspect that the user also has files elsewhere on the system you can search for them with the "find" command (you should know the users numeric id). Let us know if you want pointers on using find.

Evo2.
 
1 members found this post helpful.
Old 08-18-2010, 03:14 AM   #6
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Originally Posted by caseycolin View Post
I can see that you are putting a lot of time and effort into your blog and detailed articles! I am deeply in love with every single piece of information you post here



Term Papers
What you want to say i am also not understand. I see you all post but not find any post related to topic.
 
0 members found this post helpful.
Old 08-18-2010, 03:18 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by sem007 View Post
What you want to say i am also not understand. I see you all post but not find any post related to topic.
It was clearly spam, and I reported it as such. Don't reply to posts like that.

Evo2.
 
Old 08-18-2010, 03:19 AM   #8
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
Actually you have to rm -rf the home directory of the other user, not just rm -r, like so:

Code:
rm -rf /home/user1 #equivalent to -r -f
 
Old 08-18-2010, 03:22 AM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Quote:
Originally Posted by Kenny_Strawn View Post
Actually you have to rm -rf the home directory of the other user, not just rm -r, like so
No you don't *have* to use "-f". Anyway, always a great idea posting commands that a newb can cut and paste and hose all their data.

Evo2.
 
Old 08-18-2010, 03:22 AM   #10
antcuenco
LQ Newbie
 
Registered: Aug 2010
Location: Singapore
Posts: 10

Original Poster
Rep: Reputation: 0
Thank you guys, deeply appreciate it. I will now try it out.
 
  


Reply

Tags
rmdir, userdel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Deleting Users wilbyforce Linux - Newbie 14 09-01-2009 01:36 AM
Deleting Users sseeker Linux - Newbie 3 08-23-2007 04:52 AM
Deleting Users Ammad Linux - General 4 03-20-2007 02:38 AM
deleting users -error Debra_Dixon Linux - Newbie 6 08-10-2004 10:27 AM
deleting root users lxandrthegr8 Linux - General 3 09-06-2003 12:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:13 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration