?
Solved

useradd and userdel

Posted on 2014-04-06
2
Medium Priority
?
2,176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 1000 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 1000 total points
ID: 39981790
rm /var/spool/mail/oldusername
rm -rf /home/oldusername
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Fine Tune your automatic Updates for Ubuntu / Debian
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…
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…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 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