Reset to factory defaults

How do I reset user settings to factory defaults?

For everything else the main method I use is to do a fresh install rather than upgrade. Using kickstart and ansible I can debug the installation/configuration in a vm before touching the hardware. There are many benefits here eg: filesystem on-disk structure updates.

The careful placement of data I want to retain can be preserved by having a seperate device for HOME with valid backups.

Using ansible to add users back in but skipping all hidden directories and files when restoring HOME is one thought but it really goes too far. It would also be nice to be able to decide to “start over” on a user configuration and perform a simple task to reset to defaults.

Are the atomic variants addressing factory reset? Is there a scheme that does this for any fedora system (no matter what fedora packages are installed)? Or is this application specific needing intimate knowledge of each?

To perform a factory reset of a user account

  1. Create a temporary new user with administrator privileges

  2. Log in to that new user and assume root privileges to perform following actions.

  3. Rename the current directory of the user you want to reset to e.g. user_old.

    sudo mv /home/user /home/user_old

  4. 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 director user_old.

    sudo chmod 700 /home/user && sudo chown user:user /home/user

  5. 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.

Thanks for writing up this method.

Basically it is identical to adding users back in with an ansible playbook and restoring HOME skipping hidden files and directories.

I would like to find something better. Resets for the system and for users. Ideas have been thrown out before
Factory Reset
is there any work within fedora to accomplish this or something similar? Especially in the atomic variant realm.

I’ve been in environments using satellite 6 and performing all installations, configuration, user management etc. centrally. All data was on external storage with it’s own backup mechanism. This made many hard things easy like replacing failed hardware wholesale. Maybe the best there is is to fresh install, apply ansible playbooks and restore HOME filtering out configuration.

Is there much of a fedora community using the foreman/ansible or some other provisioning/configuration management?

See

It’s generally possible, but not convenient.

This is a great clue. I will add this work to list of things to learn.

Users directory are 700 for security reasons not 755.

sudo chmod 700 /home/user && sudo chown user:user /home/user

Thanks, I corrected this.