From a6c1b16035400a1e7ce1287ea3d76e121b5ce5ae Mon Sep 17 00:00:00 2001 From: michaelcade Date: Wed, 19 Jan 2022 16:10:17 +0000 Subject: [PATCH] Day 19 - Adding example create-user.sh into Linux Folder --- Days/Linux/create-user.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Days/Linux/create-user.sh diff --git a/Days/Linux/create-user.sh b/Days/Linux/create-user.sh new file mode 100644 index 0000000..554d6ae --- /dev/null +++ b/Days/Linux/create-user.sh @@ -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 \ No newline at end of file