Files
2023-10-25 01:14:41 +03:00

14 lines
458 B
Plaintext
Executable File

#!/usr/bin/with-contenv bash
# allow tcp forwarding within openssh settings
sed -i '/^AllowTcpForwarding/c\AllowTcpForwarding yes' /etc/ssh/sshd_config
sed -i '/^GatewayPorts/c\GatewayPorts clientspecified' /etc/ssh/sshd_config
echo "TcpForwarding is enabled"
if [ "$SHELL_NOLOGIN" == 'true' ]; then
USER_NAME=${USER_NAME:-linuxserver.io}
usermod --shell /sbin/nologin "$USER_NAME" &&
echo "Shell is set to /sbin/nologin for the user $USER_NAME"
fi