Skip to content

Commit f288614

Browse files
committed
update config path, make backwards compatible
1 parent bb25535 commit f288614

File tree

2 files changed

+10
-4
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup

2 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ Example:
1919

2020
When creating the container with the following setup:
2121
```
22-
version: '2'
2322
services:
2423
openssh-server:
25-
image: linuxserver/openssh-server
24+
image: lscr.io/linuxserver/openssh-server
2625
environment:
2726
- DOCKER_MODS=linuxserver/mods:openssh-server-ssh-tunnel
2827
- SHELL_NOLOGIN=false

root/etc/s6-overlay/s6-rc.d/init-mod-openssh-server-ssh-tunnel-setup/run

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#!/usr/bin/with-contenv bash
22

3+
# set config path
4+
if [[ -f /config/sshd/sshd_config ]]; then
5+
CONFIG_FILE_PATH="/config/sshd/sshd_config"
6+
else
7+
CONFIG_FILE_PATH="/etc/ssh/sshd_config"
8+
fi
9+
310
# allow tcp forwarding within openssh settings
4-
sed -i '/^AllowTcpForwarding/c\AllowTcpForwarding yes' /etc/ssh/sshd_config
5-
sed -i '/^GatewayPorts/c\GatewayPorts clientspecified' /etc/ssh/sshd_config
11+
sed -i '/^AllowTcpForwarding/c\AllowTcpForwarding yes' "${CONFIG_FILE_PATH}"
12+
sed -i '/^GatewayPorts/c\GatewayPorts clientspecified' "${CONFIG_FILE_PATH}"
613
echo "TcpForwarding is enabled"
714

815
if [ "$SHELL_NOLOGIN" == 'true' ]; then

0 commit comments

Comments
 (0)