Merge pull request #982 from linuxserver/openssh-server-ssh-tunnel-configpath

update config path, make backwards compatible
This commit is contained in:
aptalca
2024-11-26 15:42:14 -05:00
committed by GitHub
2 changed files with 10 additions and 4 deletions
+1 -2
View File
@@ -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
@@ -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