Skip to content

Instantly share code, notes, and snippets.

@benhg
Created May 29, 2019 23:21
Show Gist options
  • Save benhg/6f8257300453eda6c2bf32ce45c06442 to your computer and use it in GitHub Desktop.
Save benhg/6f8257300453eda6c2bf32ce45c06442 to your computer and use it in GitHub Desktop.
USER='username'
PASS='passwd'
sudo useradd -m -d /home/$USER --password $(echo "$PASS" | openssl passwd -1 -stdin ) $USER
# omit 1,2 if env variables are otherwise set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment