Created
July 29, 2018 16:14
-
-
Save iamshreeram/d6046d70a5e285ef4f00704abca6d3e1 to your computer and use it in GitHub Desktop.
Adding user to unix server
This file contains hidden or 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
| 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