Solved

useradd and userdel

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Hosting 16 80
Impact of disabling SMB v1 on Mac and Linux clients 4 696
blank screen when trying to setup Unity on Ubuntu 14.04 9 56
Enable SPF on IMSVA 6 24
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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…
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.

726 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