-1

ubuntu 16.04 lts

After creating a user with useradd

sudo useradd -G sudo -m -d /home/user -s /bin/bash user

and then deleting it with

`sudo deluser user`

the user still appears after typing

 ls -l /home

Shouldn't it be gone?

output of ls -l /home

ls -l /home
total 4
drwxr-xr-x 2 1000 1000 4096 Jun  6 15:04 user

p.s. it also prompts for a user password even though a user password has not been set when trying to log in to the user. After creating the user the server cannot be accessed with the user. Only when using ecryptfs-utils can a password for the user be set.

loophunt
  • 21
  • 2

1 Answers1

2

Per the man page. deluser does not remove the home directories unless you pass the --remove-home option.

Man

By default, deluser will remove the user without removing the home directory, the mail spool or any other files on the system owned by the user. Removing the home directory and mail spool can be achieved using the --remove-home option.

Also, if you want to know if a user is gone, a better command to run would be getent passwd or getent passwd username

Zoredache
  • 130,897
  • 41
  • 276
  • 420