SSH: Add local TCP forwarding option (#1364)

* SSH: Add local TCP forwarding option

Add allow_tcp_forwarding option, to allow local port forwarding by the SSH add-on. Code lifted from the more advanced [SSH & Web Terminal](https://github.com/hassio-addons/addon-ssh) add-on.

* Bump version to 8.6.0

* SSH: Rename tcp_forwarding option

* Update ssh.sh

* Update DOCS.md

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
This commit is contained in:
adamgreg
2020-06-03 15:32:00 +01:00
committed by GitHub
parent 79213cad3d
commit 98b234f9f7
4 changed files with 29 additions and 4 deletions

View File

@@ -29,3 +29,8 @@ elif bashio::config.has_value 'password'; then
elif bashio::var.has_value "$(bashio::addon.port 22)"; then
bashio::exit.nok "You need to setup a login!"
fi
# Allow TCP forwarding
if bashio::config.true 'server.tcp_forwarding'; then
sed -i "s/AllowTcpForwarding.*/AllowTcpForwarding\\ yes/" /etc/ssh/sshd_config
fi