Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update config path, make backwards compatible #982

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down