Solved

useradd and userdel

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.

803 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