How do you safely remove a local user?
BeginnerProductionUser Lifecycle, Auditing & Time Sync
Answer
sudo pkill -KILL -u bob # end their processes
sudo crontab -r -u bob # remove crontab
sudo tar czf /root/archive/bob-home.tgz /home/bob
sudo userdel -r bob # remove user, home and mail spool
sudo find / -xdev -nouser -ls 2>/dev/null # leftover files elsewhere
On Debian deluser --remove-home bob is the friendlier wrapper.
More on User Lifecycle, Auditing & Time Sync
How do you manage Linux users across hundreds of servers?BeginnerWhat is SSSD?IntermediateWhat should happen in the offboarding process for an engineer with server access?IntermediateHow should service accounts be created and governed?IntermediateHow do you review who has access to a server?IntermediateWhat is auditd and what is it used for?Beginner