How do I reset user settings to factory defaults?
To perform a factory reset of a user account
-
Create a temporary new user with administrator privileges
-
Log in to that new user and assume root privileges to perform following actions.
-
Rename the current directory of the user you want to reset to e.g.
user_old
.sudo mv /home/user /home/user_old
-
Create a new directory for that user, e.g.
/home/user
, change ownership to that user and check the permissions such that ownership and permissions are the same as that of the original home directoruser_old
.sudo chmod 700 /home/user && sudo chown user:user /home/user
-
Copy all (hidden) files from
/etc/skel
to the new/home/user
.sudo cp -r /etc/skel/.* /home/user
Log out and log back in to the account of the regular user. It will be configured according to factory default.
Now you can move back the user files from /home/user_old
to /home/user
. When done (and certain no user files are left behind), you can remove /home/user_old
, and remove the temporary account.
Although no data is erased, it still is wise (mandatory) to update the backup of the user data before proceeding.
This could be scripted to move everything out from a home directory, then place back the skeleton files and move back data in the user folders Documents
, Images
, etc. I am not aware of specific system facilities or tools to facilitate factory reset of a user account. Resetting configuration of a user account essentially comes down to removing hidden files and directories in the home directory.
See
It’s generally possible, but not convenient.
Users directory are 700 for security reasons not 755.
sudo chmod 700 /home/user && sudo chown user:user /home/user
Thanks, I corrected this.