sudo deluser --remove-home your_user deletes the home directories as well as the user entries.
The additional option --remove-all-files even removes all the files owned by the user.
deleting a created user . how to..
i need help deleting my user account
Disable GUI
If you wanted to completely remove desktop environment from your system, there was an option to not have them in the first place during installation, here: http://cdn.arstechnica.net/wp-content/uploads/2015/04/debian-installer-tasksel.png
From an already installed system, to completely uninstall graphical environment I guess you could just sudo apt-get purge x11-* libx11-* --auto-remove
Yesterday I Learned: You can remove sudo
What is the difference between adduser and useradd on Debian?
Does `userdel` delete the home directory?
Does deleting a user remove their cron jobs?
Videos
sudo deluser --remove-home your_user deletes the home directories as well as the user entries.
The additional option --remove-all-files even removes all the files owned by the user.
Now that you have deleted the user accounts, neither deluser nor userdel will know anything about them or their home directories, since the corresponding /etc/passwd entries are gone. Just manually delete the directories once you have backed up any valuable data:
sudo rm -r /home/user1 /home/user2 ...
You could, of course, have deleted the directories while deleting the user like the other answers suggested.
to list all users :
cut -d: -f1 /etc/passwd
To remove user :
sudo userdel username
To remove home directory :
sudo rm -r /home/username
To add a home directory to an existing user :
create a home directory
chown this directory for the user
sudo usermod -d /home/directory user
You can use the more advanced deluser command:
sudo deluser --remove-home user
You can also try the the --remove-all-files option. From man deluser:
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.
The --remove-all-files option removes all files on the system owned by
the user. Note that if you activate both options --remove-home will
have no effect because all files including the home directory and mail
spool are already covered by the --remove-all-files option.
As can be expected, the second option may take a while to complete.
hi good people
how to delete a created user properly ? , i have created a new user due to testing and i followed instructions from the web on how to delete user , but the user still showing in the login screen
. how to properly delete a user ?