Skip to content

Instantly share code, notes, and snippets.

@iamshreeram
Created July 29, 2018 16:14
Show Gist options
  • Save iamshreeram/d6046d70a5e285ef4f00704abca6d3e1 to your computer and use it in GitHub Desktop.
Save iamshreeram/d6046d70a5e285ef4f00704abca6d3e1 to your computer and use it in GitHub Desktop.
Adding user to unix server
useradd -m username
passwd userpassword
# OPEN sudo visudo
# ADD a group like below
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
%somegroupname ALL=(ALL) ALL
# Save your changes and exit the editor.
# Add the user you created to the wheel group using the usermod command
usermod -aG wheel USERNAME
# Test the addition of USERNAME to group by sudo'ing to user
su USERNAME -
# To verify the groups of username
groups
> USERNAME somegroupname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment