Repository navigation
How to safely remove Entra users and their home folders #1256
Replies: 3 comments
|
This should probably be a Discussion rather than an Issue, but in any case, it looks like you are confusing the user accounts themselves and the home directories which belong to them? For Windows devices, you are saying that your process is to delete/deactivate a User Account (presumably in Active Directory or Entra) and then later delete the associated user profile or C:\Users<username> folder to free up space locally on device? The Linux process here would be the same for the former (account deactivation/deletion occurs in ADUC or the Entra admin portal), and then the equivalent deletion of their profile/home directory with rm -f /home/ (or wherever you have user home dirs stored/mounted). Userdel is an operation on local users, which Entra users generally are not (via Himmelblau). You handle account management within AD/Entra instead, regardless of OS. If your follow-up question is going to be "how do I query Himmelblau for Entra user accounts which are no longer active or do not exist, but still have a local home directory on disk taking up space?", then that may well be outside the scope of this project. You could always raise it as a separate Feature Request, but you would have to do significant testing and guarding of active user home directories to avoid accidental deletions and data loss... More likely, you would have to develop your own tooling outside of Himmelblau to handle scripting this and the flagging of: A) User homes which exist: for userName in /home; Rough outline (just an outline, you would need to rewrite and test this, most likely having it be its own systemd service or cronjob): This assumes user homes are stored locally, on device? The implication from your questioning is that you are not using network mounted home directories (e.g. NFSv4). I would strongly recommend only having the checks be automated, then always have someone manually review and run the deletion themselves. Scripting mass user/home status checks with automated deletion without authorised personnel having eyeballs on this is asking for trouble. There are other questions here that you would have to consider like your organisation's policies and procedures, e.g. data retention: how long you keep this data for after ex-users have left? HR/Litigation hold: if someone tells you that you cannot delete user data for a VeryGoodReason™, then how do you guard against that in your automated scripting & manual deletion process? That's off the top of my head, there is almost certainly more to consider here. |
|
I’m going to move this into a discussion. |
|
FYI, https://himmelblau-idm.org/docs/troubleshooting/Troubleshooting%3A-%60The-user-%27...%27-already-exists%60-and-fake-users-listed-in-NSS/ is completely unrelated. That's an issue that crops up if you have cn_name_mapping enabled (the default) and you've disabled user enumeration in Entra ID (which doesn't actually disable enumeration, Microsoft chose to simply enumerate EVERYTHING, meaning every possible username exists). So that isn't at all related. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
Hi everyone,
I'm currently testing himmelblau in an education environment. Something we usually do on Windows computers is automatically delete user accounts after a certain amount of time, this is to save storage space as students will eventually leave and accounts will pile up.
Since Entra users aren't created as local accounts I cannot remove them with
userdel. I understand there's a database where all this information is stored but I'm not sure how to gracefully remove users from all of the relevant files so I can remove the home folder safely.P.S does it have something to do with this?
Thanks,
Camden
Steps to Reproduce
sudo userdel -r <user>Relevant log output
user '<user>' does not existVersion
3.1.0-ubuntu24.04
Code of Conduct
💡 Help Make It Happen!
Want to see this issue resolved faster? Fund its implementation through our Backer's Bounty program, where you choose which issues get priority!
For US tax exempt donations:
Your support helps drive Himmelblau’s evolution!
All reactions