mirror of
https://github.com/darksaid98/ubuntu-server-setup.git
synced 2026-12-01 22:22:31 +00:00
Remove the need for prompting the user for a password (#12)
Relates to issue #9
This commit is contained in:
1 parent
ce73240765
commit
153087929c
4 files changed
+5
-27
No files matched your search
+2
-4
@@ -3,12 +3,10 @@
|
||||
# Add the new user account
|
||||
# Arguments:
|
||||
# Account Username
|
||||
# Account Password
|
||||
# Flag to determine if user account is added silently. (With / Without GECOS prompt)
|
||||
function addUserAccount() {
|
||||
local username=${1}
|
||||
local password=${2}
|
||||
local silent_mode=${3}
|
||||
local silent_mode=${2}
|
||||
|
||||
if [[ ${silent_mode} == "true" ]]; then
|
||||
sudo adduser --disabled-password --gecos '' "${username}"
|
||||
@@ -16,8 +14,8 @@ function addUserAccount() {
|
||||
sudo adduser --disabled-password "${username}"
|
||||
fi
|
||||
|
||||
echo "${username}:${password}" | sudo chpasswd
|
||||
sudo usermod -aG sudo "${username}"
|
||||
sudo passwd -d "${username}"
|
||||
}
|
||||
|
||||
# Add the local machine public SSH Key for the new user account
|
||||
|
||||
Reference in new issue
Block a user