File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -892,10 +892,10 @@ rm -f /usr/sbin/policy-rc.d
892892sed -i " s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
893893
894894# Enable SFTP subsystem for SSH
895- sftp_subsys_enabled=$( grep " #Subsystem sftp-server" /etc/ssh/sshd_config)
895+ sftp_subsys_enabled=$( grep -iE " ^#?.*subsystem.+(sftp )? sftp-server" /etc/ssh/sshd_config)
896896if [ ! -z " $sftp_subsys_enabled " ]; then
897897 echo " (*) Updating SFTP subsystem configuration..."
898- sed -i " s/# Subsystem sftp-server/Subsystem sftp internal-sftp/gI " /etc/ssh/sshd_config
898+ sed -i -E " s/^#?.* Subsystem.+(sftp )? sftp-server/Subsystem sftp internal-sftp/g " /etc/ssh/sshd_config
899899fi
900900
901901# Disable SSH suffix broadcast
Original file line number Diff line number Diff line change @@ -866,10 +866,10 @@ rm -f /usr/sbin/policy-rc.d
866866sed -i " s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config
867867
868868# Enable SFTP subsystem for SSH
869- sftp_subsys_enabled=$( grep " #Subsystem sftp-server" /etc/ssh/sshd_config)
869+ sftp_subsys_enabled=$( grep -iE " ^#?.*subsystem.+(sftp )? sftp-server" /etc/ssh/sshd_config)
870870if [ ! -z " $sftp_subsys_enabled " ]; then
871871 echo " (*) Updating SFTP subsystem configuration..."
872- sed -i " s/# Subsystem sftp-server/Subsystem sftp internal-sftp/gI " /etc/ssh/sshd_config
872+ sed -i -E " s/^#?.* Subsystem.+(sftp )? sftp-server/Subsystem sftp internal-sftp/g " /etc/ssh/sshd_config
873873fi
874874
875875# Disable SSH suffix broadcast
Original file line number Diff line number Diff line change 345345$HESTIA /bin/v-add-sys-sftp-jail
346346
347347# Enable SFTP subsystem for SSH
348- sftp_subsys_enabled=$( cat /etc/ssh/sshd_config | grep " #Subsystem sftp-server" )
348+ sftp_subsys_enabled=$( grep -iE " ^#?.*subsystem.+(sftp )? sftp-server" /etc/ssh/sshd_config )
349349if [ ! -z " $sftp_subsys_enabled " ]; then
350350 echo " (*) Updating SFTP subsystem configuration..."
351- sed -i " s/# Subsystem sftp-server/Subsystem sftp internal-sftp/gI " /etc/ssh/sshd_config
351+ sed -i -E " s/^#?.* Subsystem.+(sftp )? sftp-server/Subsystem sftp internal-sftp/g " /etc/ssh/sshd_config
352352 service ssh restart
353353fi
354354
You can’t perform that action at this time.
0 commit comments