mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-06-15 04:43:01 -04:00
Merge pull request #982 from linuxserver/openssh-server-ssh-tunnel-configpath
update config path, make backwards compatible
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user