Add the parameter SHELL_NOLOGIN

This commit is contained in:
Burhan Del Rey
2023-05-23 01:24:13 +03:00
parent 711a3d1b18
commit 7f2c86719f
2 changed files with 14 additions and 0 deletions
@@ -4,3 +4,10 @@
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