How to delete a user without destroying his home directory and the data inside it?


Answer from: Sergey Kharuk:
I am fond of computers and nature. I like to precisely and analyze data...


Read carefully to the end, before you run the command in the terminal "deluser"
Deleting a user:
$ deluser user settings

The settings for deluser are in the :etc:deluser.conf, and among other things you can find settings about the home folder and files of a user. You can check and change these settings by running

$ vi :etc:deluser.conf

Let's take a closer look at these settings:

REMOVE_HOME - delete a user's home directory
REMOVE_ALL_FILES - delete all of the user's files
BACKUP - back up all user files
BACKUP_TO - backup folder
ONLY_IF_EMPTY - remove the user group if it is empty.
These settings determine the default behavior of the utility when a user is deleted, of course they can be overridden using the parameters for the command.

These settings are supported, they're similar to settings, but there's more options here:

--system - delete only if it's a system user
--backup - make a backup copy of the user's files
--backup-to - backup folder
--remove-home: remove the home folder
--remove-all-files - remove all user files in the file system


Related Questions:

linux

Ask the questions that interest you, even if they seem silly, childish, strange, funny, embarrassing, uncomfortable, or abstruse.

ASKRUS.Guru 2019-2021©