Solved

useradd and userdel

Posted on 2014-04-06
2
1,716 Views
Last Modified: 2014-04-06
I performed a useradd, but wanted to start over

So I performed a userdel

Now when I try to use the useradd on that same ID, I get the following

[root@mmclnt1 test]# useradd usern
Creating mailbox file: File exists

What I want is to be able to perform the useradd again, after previously deleting it, and NOT get the mailbox warning

How can I do this, is there some option I need on userdel ?
0
Comment
Question by:Anthony Lucia
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 250 total points
ID: 39981670
Use the "-r" flag of "userdel":

userdel -r usern

From "man userdel" (emphasis mine):
-r, --remove
    Files in the user's home directory will be removed along with the home directory itself and the user's mail spool.
0
 
LVL 23

Assisted Solution

by:Mysidia
Mysidia earned 250 total points
ID: 39981790
rm /var/spool/mail/oldusername
rm -rf /home/oldusername
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now