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

Update useradd script to prevent warnings #837

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Update useradd script to prevent warnings #837

merged 1 commit into from
Sep 19, 2023

Conversation

daniel-fahey
Copy link
Contributor

Not sure if this script is still recommended to use as it's not been modified in nearly a decade.

  1. Modified the useradd command by removing the -m option to prevent unnecessary warnings about the home directory already existing. The creation of the home directory is managed separately in this script using Btrfs subvolumes.

  2. Added a command to copy the standard skeleton files from /etc/skel to the new user's home directory, ensuring that new users receive the necessary setup files despite the custom home directory creation process with the create-config command.

  3. Corrected the chown command syntax to use the more modern : separator between the user and group names, getting rid of another warning.

I kept the (old school) style as is. Thanks for snapper!

…lity

Not sure if this script is still recommended to use as it's not been modified in nearly a decade.

1. Modified the `useradd` command by removing the `-m` option to prevent unnecessary warnings about the home directory already existing. The creation of the home directory is managed separately in this script using Btrfs subvolumes.
   
2. Added a command to copy the standard skeleton files from `/etc/skel` to the new user's home directory, ensuring that new users receive the necessary setup files despite the custom home directory creation process with the `create-config` command.

3. Corrected the `chown` command syntax to use the more modern `:` separator between the user and group names, getting rid of another warning.

I kept the (old school) style as is. Thanks for snapper!
@aschnell
Copy link
Member

aschnell commented Sep 18, 2023

The script is likely bare used (esp. with the DRYRUN=1 setting).

Anyway, I still get a warning about the home directory already existing unless I add -M. Likely you do not have "CREATE_HOME yes" in login.defs

@aschnell aschnell merged commit 0641911 into openSUSE:master Sep 19, 2023
5 checks passed
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.

2 participants