Skip to content

Instantly share code, notes, and snippets.

@hottabxp
Forked from benhg/add_user_from_env
Created September 16, 2021 17:07
Show Gist options
  • Save hottabxp/6bb5aa2d528074306b24518b2261fb0b to your computer and use it in GitHub Desktop.
Save hottabxp/6bb5aa2d528074306b24518b2261fb0b 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