Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed old users and group before creating new ones #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

removed old users and group before creating new ones #134

wants to merge 2 commits into from

Conversation

tobias-m
Copy link

We need to ensure that old users and groups are deleted first, before creating new ones. Otherwise user ids und group ids can conflict.

@0xf10e
Copy link
Contributor

0xf10e commented Dec 3, 2016

Wouldn't it be more sensible to create new users first?
When you free up UIDs and GIDs the new users or groups may "inherit" files owned by the ones you just removed.
I don't think gaps in the range of IDs to used get filled up. If UIDs 1005 to 1010 are already in use I'd assume when you delete the users with the IDs 1005 and 1009 the next two to be assigned would still be 1011 and 1012.

@tobias-m
Copy link
Author

tobias-m commented Dec 9, 2016

It's not possible to create a user or group if the correspondig id already exists, which might be the case if UID and GID are self defined and not auto assigned. If you worry about inherited files, you can set force during user removal.

@0xf10e
Copy link
Contributor

0xf10e commented Feb 26, 2017

I wasn't talking about the home directory here but other things in the filesystem, say write access to something in /var/www. userdel -r (used in modules.useradd, as an example for the various user modules) only removes the user's $HOME and their mailspool (see userdel(8)).

@tobias-m
Copy link
Author

From my point of view, there should be no files outside of users home folder (talking about non system users) owned by them to prevent your described problem resulting in several other problems. Files inside /var/www are usually owned by the web server (system) user.

@noelmcloughlin
Copy link
Member

Hi @tobias-m Can you fix the conflict? thx

@noelmcloughlin
Copy link
Member

ping @tobias-m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants