Created
January 16, 2018 14:38
-
-
Save ivankeller/f1b989616f7f2d1eded9f6ecdd15297a to your computer and use it in GitHub Desktop.
Recreate a known user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Recreate a user that was created previously | |
# TODO: this onworking script has the side effect of setting the ownership badly on user with | |
# previous same userid. Must be fixed. | |
# create user | |
username=$1 | |
adduser $username --home /data/users/$username | |
# add user to sudoers | |
usermod -aG sudo $username | |
# relink the user with his directory | |
chown -R $username:$username /data/users/$username |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment