From 5c9953e455e16aaf7a8c51a5f2982f3964189782 Mon Sep 17 00:00:00 2001 From: m8in Date: Mon, 30 Mar 2026 21:15:03 +0200 Subject: [PATCH] Commands for user administration added --- script/host/user/addNormalUser.sh | 8 ++++++++ script/host/user/addUserToSSH_LoginGroup.sh | 3 +++ script/host/user/removeUserFromSSH_LoginGroup.sh | 3 +++ 3 files changed, 14 insertions(+) create mode 100755 script/host/user/addNormalUser.sh create mode 100755 script/host/user/addUserToSSH_LoginGroup.sh create mode 100755 script/host/user/removeUserFromSSH_LoginGroup.sh diff --git a/script/host/user/addNormalUser.sh b/script/host/user/addNormalUser.sh new file mode 100755 index 0000000..380853d --- /dev/null +++ b/script/host/user/addNormalUser.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +#WARNING: Used for core functionality in setup.sh +# DO NOT rename the script and test changes well! + +_SCRIPT_FOLDER="$(dirname $(readlink -f "${0}" 2> /dev/null) 2> /dev/null)" +_ROOT="${_SCRIPT_FOLDER%%/script/*}/" #Removes longest matching pattern '/script/*' from the end +source "${_ROOT:?"Missing ROOT"}core/addNormalUser.sh" "${1:?"Missing first parameter USER"}" && exit 0 || exit 1 diff --git a/script/host/user/addUserToSSH_LoginGroup.sh b/script/host/user/addUserToSSH_LoginGroup.sh new file mode 100755 index 0000000..a2dfcd6 --- /dev/null +++ b/script/host/user/addUserToSSH_LoginGroup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo usermod --append --groups ssh_login "${1:?"Missing first parameter USER"}" diff --git a/script/host/user/removeUserFromSSH_LoginGroup.sh b/script/host/user/removeUserFromSSH_LoginGroup.sh new file mode 100755 index 0000000..5a75354 --- /dev/null +++ b/script/host/user/removeUserFromSSH_LoginGroup.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +sudo usermod --remove --groups ssh_login "${1:?"Missing first parameter USER"}"