For the install:
Preserve cron
, batch
and at
jobs. Look in /var/spool/
.
Preserve copies of locally modified files in the /etc
directory tree.
Preserve locally installed applications. Save the configuration files, be ready to reinstall current versions of applications.
apt changelog packagename
is your friend.
Everything outside /home
will be destroyed by the install.
For /home
:
You can tell the installer (the "Something Else" choice?) to put /home
where you have it, and UNCheck the box in the "Format" column. Verify. DO NOT FORMAT /home.
For the UIDs - keep copies of /etc/{passwd,shadow,group,gshadow}
. Understand these files! Read man -a passwd;man shadow group getent
Let the installer create a temporary
userid, UID 1000, homedir /home/temporary
.
After the install, login as temporary
.
First, in one window, sudo bash
. This is your Emergency Investigation and Recovery Window.
In another window, sudo bash
.
Make another, separate backup copy of /etc/{passwd,shadow,group,gshadow}
Use your original copies to restore your groups and userids. Do NOT blindly copy the old files, think carefully about each entry.
Note that (passwd
and shadow
) and (group
and gshadow
) entries should be updated in pairs, both or neither.
Use getent
to check your work. E.g. getent passwd special
Only after testing:
- login by the special user?
- can the special user still special?
- login by your admin user?
- can admin still
sudo
?
- ...
Can you log out. Then, log in as your admin account, and delete the temporary
user. Read man deluser
.