Skip to content

Instantly share code, notes, and snippets.

@theriverman
Created July 3, 2017 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theriverman/fcbe99ac6cb51d3c4ab49492663b86f0 to your computer and use it in GitHub Desktop.
Save theriverman/fcbe99ac6cb51d3c4ab49492663b86f0 to your computer and use it in GitHub Desktop.
Create user with password shell-script
#!/bin/sh
# after `=` type the user account and password you wish to create respectively
user=your_selected_account_name
password=your_supersecret_password
adduser --quiet --disabled-password --shell /bin/bash --home /home/$user --gecos "User" $user
# set password
echo "$user:$password" | chpasswd
echo User: $user has been created with password: $password
#SCRIPT END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment