Skip to content

Commit 79d14b3

Browse files
committed
openssh: unifying debug and release settings
1 parent 795a39c commit 79d14b3

1 file changed

Lines changed: 8 additions & 17 deletions

File tree

packages/openssh.sh

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)