File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,23 +49,14 @@ install_openssh() {
4949
5050 mkdir -p -m 700 " ${ROOTDIR} /root/.ssh"
5151
52- if [ " ${BUILDMODE} " == " release" ]; then
53- echo " [+] hardening openssh server settings"
54-
55- # hardening authentication
56- sed -i ' s/#Port 22/Port 34022/g' " ${ROOTDIR} " /etc/ssh/sshd_config
57- sed -i ' s/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/g' " ${ROOTDIR} " /etc/ssh/sshd_config
58- sed -i ' s/#PasswordAuthentication yes/PasswordAuthentication no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
59- sed -i ' s/#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
60- sed -i ' s/#UsePAM no/UsePAM no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
61- else
62- echo " [+] enable debug ssh settings"
63-
64- # keep debugging mode more permissive
65- sed -i ' s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' " ${ROOTDIR} " /etc/ssh/sshd_config
66- sed -i ' s/#PasswordAuthentication yes/PasswordAuthentication yes/g' " ${ROOTDIR} " /etc/ssh/sshd_config
67- sed -i ' s/#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication yes/g' " ${ROOTDIR} " /etc/ssh/sshd_config
68- fi
52+ echo " [+] hardening openssh server settings"
53+
54+ # hardening authentication
55+ sed -i ' s/#Port 22/Port 34022/g' " ${ROOTDIR} " /etc/ssh/sshd_config
56+ sed -i ' s/#PermitRootLogin prohibit-password/PermitRootLogin prohibit-password/g' " ${ROOTDIR} " /etc/ssh/sshd_config
57+ sed -i ' s/#PasswordAuthentication yes/PasswordAuthentication no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
58+ sed -i ' s/#KbdInteractiveAuthentication yes/KbdInteractiveAuthentication no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
59+ sed -i ' s/#UsePAM no/UsePAM no/g' " ${ROOTDIR} " /etc/ssh/sshd_config
6960
7061 unset CFLAGS
7162 unset LDFLAGS
You can’t perform that action at this time.
0 commit comments