cmd-run: Only forward SSH port on localhost
`cosa run` is mainly targeted at local development. We don't really want
to make SSH available on e.g. the host LAN.
@@ -324,7 +324,7 @@ if [ -n "${SSH_PORT}" ]; then
SSH_PORT=$(python3 -c "import socket; sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM); sock.bind(('', 0)); print(sock.getsockname()[1])")
echo "SSH port: ${SSH_PORT}"
fi
- hostfwd=",hostfwd=tcp::${SSH_PORT}-:22"
+ hostfwd=",hostfwd=tcp:127.0.0.1:${SSH_PORT}-:22"
fi
if [ -n "${SSH_CONFIG}" ]; then
