Skip to content

Commit 8fa8f91

Browse files
author
Kristan Kenney
committed
Update v-suspend-user
1 parent 949fdfd commit 8fa8f91

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

bin/v-suspend-user

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ check_hestia_demo_mode
4242
#----------------------------------------------------------#
4343
# Action #
4444
#----------------------------------------------------------#
45-
46-
# Adding '!' in front of the password
47-
/usr/sbin/usermod --lock $user
48-
49-
# Suspending ftp accounts
50-
for ftp in $(grep "^${user}_" /etc/passwd |cut -f 1 -d : ); do
51-
/usr/sbin/usermod --lock $ftp 2>/dev/null
52-
done
45+
# Do not restrict access to SFTP/FTP/SSH if POLICY_USER_VIEW_SUSPENDED is set to yes
46+
if [ -z "$POLICY_USER_VIEW_SUSPENDED" ] || [ "$POLICY_USER_VIEW_SUSPENDED" = 'no' ]; then
47+
# Adding '!' in front of the password
48+
/usr/sbin/usermod --lock $user
49+
50+
# Suspending ftp accounts
51+
for ftp in $(grep "^${user}_" /etc/passwd |cut -f 1 -d : ); do
52+
/usr/sbin/usermod --lock $ftp 2>/dev/null
53+
done
54+
fi
5355

5456
# Suspending web domains
5557
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then

0 commit comments

Comments
 (0)