2022-04-05 18:07:14 +02:00
|
|
|
#!/bin/sh
|
2022-04-10 04:21:44 +02:00
|
|
|
[ -n "${DEBUG}" ] && set -x
|
2022-04-05 18:07:14 +02:00
|
|
|
set -eu
|
|
|
|
|
|
|
|
sed -i "s/^#\?PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PermitRootLogin.*/PermitRootLogin no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PermitEmptyPasswords.*/PermitEmptyPasswords no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PermitTTY.*/PermitTTY no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PermitTunnel.*/PermitTunnel no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PermitUserEnvironment.*/PermitUserEnvironment no/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PrintLastLog.*/PrintLastLog yes/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
|
|
|
|
sed -i "s/^#\?X11Forwarding.*/X11Forwarding no/g" /etc/ssh/sshd_config
|
2022-11-22 23:49:44 +01:00
|
|
|
sed -i "s/^#\?Port.*/Port ${SSH_PORT:-22}/g" /etc/ssh/sshd_config
|
2022-04-05 18:07:14 +02:00
|
|
|
|
|
|
|
cat >> /etc/ssh/sshd_config <<EOF
|
|
|
|
Match group x2gouser
|
|
|
|
AllowAgentForwarding yes
|
|
|
|
AllowTcpForwarding yes
|
|
|
|
PermitTTY yes
|
|
|
|
EOF
|