diff --git a/README.md b/README.md index 82838f44..101e34f7 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,9 @@ Example: When creating the container with the following setup: ``` -version: '2' services: openssh-server: - image: linuxserver/openssh-server + image: lscr.io/linuxserver/openssh-server environment: - DOCKER_MODS=linuxserver/mods:openssh-server-ssh-tunnel - SHELL_NOLOGIN=false diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup/run b/root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup/run index b0873e2a..a3f4eb6d 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup/run @@ -1,8 +1,15 @@ #!/usr/bin/with-contenv bash +# set config path +if [[ -f /config/sshd/sshd_config ]]; then + CONFIG_FILE_PATH="/config/sshd/sshd_config" +else + CONFIG_FILE_PATH="/etc/ssh/sshd_config" +fi + # 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 +sed -i '/^AllowTcpForwarding/c\AllowTcpForwarding yes' "${CONFIG_FILE_PATH}" +sed -i '/^GatewayPorts/c\GatewayPorts clientspecified' "${CONFIG_FILE_PATH}" echo "TcpForwarding is enabled" if [ "$SHELL_NOLOGIN" == 'true' ]; then