Day 19 - Adding example create-user.sh into Linux Folder

This commit is contained in:
michaelcade 2022-01-19 16:10:17 +00:00
parent 74716b4713
commit a6c1b16035

15
Days/Linux/create-user.sh Normal file
View File

@ -0,0 +1,15 @@
#! /usr/bin/bash
echo "What is your intended username?"
read username
echo "What is your password"
read password
#A user can be passed in as a command line argument
echo "$username user account being created."
#A user is created with the name of command line argument
sudo useradd -m $username
#A password can be parsed in as a command line argument.
sudo chpasswd <<< $username:$password