Compare commits

..

2 Commits

Author SHA1 Message Date
Clemens Schwaighofer
365b52efe5 Bug fix with user_list.txt variable in wrong script. Must be in unlock script not check script 2022-12-02 09:32:27 +09:00
Clemens Schwaighofer
b10cb62612 Fix unlock script with debug comment out code 2022-12-02 09:28:09 +09:00
2 changed files with 3 additions and 4 deletions

View File

@@ -5,7 +5,6 @@
# base folder
BASE_FOLDER=$(dirname $(readlink -f $0))"/";
input_file='user_list.txt';
# which groups holds the ssh allowed login users (outside of admin users)
ssh_groups=('sshforward' 'sshallow');
ssh_reject_group='sshreject';

View File

@@ -42,6 +42,7 @@ if [ ! -z "${SSH_GROUP_ADD}" ] && [ "${SSH_GROUP_ADD}" != "allow" ] && [ "${SSH_
fi;
BASE_FOLDER=$(dirname $(readlink -f $0))"/";
input_file='user_list.txt';
# ignore users (root and admin users)
ignore_users=('root' 'ec2-user' 'ubuntu' 'admin');
# ssh reject group
@@ -100,9 +101,8 @@ for username in "$@"; do
if [ ${TEST} -eq 1 ]; then
printf "${user_group_tpl}" "${username}" "${ssh_reject_group}" "${username}" "${ssh_add_group}";
else
#gpasswd -d "${username}" "${ssh_reject_group}";
#gpasswd -a "${username}" "${ssh_add_group}";
echo "NOOP";
gpasswd -d "${username}" "${ssh_reject_group}";
gpasswd -a "${username}" "${ssh_add_group}";
fi;
else
# skip not ssh user