Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Remove a user

I know how to add a user, but I can't seem to get rid of them. How do I do this? Is there a similiar command to "adduser" or is it way more complicated? I am using Red Hat version 5.0 but also have the same problem on a slackware machine in the building.
0
Schandor
Asked:
Schandor
  • 2
  • 2
1 Solution
 
fmismettiCommented:
Use the following command:

userdel loginname

or

userdel -r loginname

With -r you delete the user and also remove the user's home directory. This command works for sure with slackware.

Hope it helps
0
 
SchandorAuthor Commented:
OK fmismetti's answer worked on the Red Hat but did not work on the slackware. I kept getting a Bash: Command not found. Is there a way that I can load this command in. We kind of inherited the slackware's configuration but now we are stuck with it being our mail server.
0
 
SchandorAuthor Commented:
OK fmismetti's answer worked on the Red Hat but did not work on the slackware. I kept getting a Bash: Command not found. Is there a way that I can load this command in. We kind of inherited the slackware's configuration but now we are stuck with it being our mail server.
0
 
fmismettiCommented:
Well, normally you have this utility in every plain installation of slackware, under /usr/sbin/userdel. If you have access to a CD containing slackware....

If no, you can remove a user manually, just editing:

/etc/passwd - user account information
/etc/shadow - secure user account information
/etc/group - group information

Remove the entire line containing reference to the user in the first two files and remove reference to the user in the third. Then remove the directory /home/username.

0
 
shootersCommented:
Don't forget to delete thier mailbox from /var/spool/mail
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now