Skip to content

Instantly share code, notes, and snippets.

@seandavi
Created December 1, 2017 14:49
Show Gist options
  • Save seandavi/f984fa4601c2e854e540c2867ea640c2 to your computer and use it in GitHub Desktop.
Save seandavi/f984fa4601c2e854e540c2867ea640c2 to your computer and use it in GitHub Desktop.
Add new user to linux machine non-interactively
# I often want to add new users
# to AWS machines in a semi-automated
# script, perhaps via SSH. Doing
# so noninteractively took some search
# work.
sudo useradd USERNAME
echo "USERNAME:NEWPASSWORD" | sudo chpasswd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment