Solved

useradd and userdel

Posted on 2014-04-06
2
1,882 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

792 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