mirror of
https://github.com/m8tin/cis.git
synced 2026-04-02 19:01:30 +02:00
Commands for user administration added
This commit is contained in:
8
script/host/user/addNormalUser.sh
Executable file
8
script/host/user/addNormalUser.sh
Executable file
@@ -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
|
||||||
3
script/host/user/addUserToSSH_LoginGroup.sh
Executable file
3
script/host/user/addUserToSSH_LoginGroup.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo usermod --append --groups ssh_login "${1:?"Missing first parameter USER"}"
|
||||||
3
script/host/user/removeUserFromSSH_LoginGroup.sh
Executable file
3
script/host/user/removeUserFromSSH_LoginGroup.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sudo usermod --remove --groups ssh_login "${1:?"Missing first parameter USER"}"
|
||||||
Reference in New Issue
Block a user