Make SSH_PORT configurable

This commit is contained in:
Tom Wiesing 2022-11-17 09:43:01 +01:00
parent 2bcd70c1ec
commit 4752c0fcec
No known key found for this signature in database
9 changed files with 25 additions and 7 deletions

View file

@ -3,6 +3,7 @@ package ssh2
import (
"bufio"
"io"
"strconv"
"strings"
"github.com/gliderlabs/ssh"
@ -34,7 +35,7 @@ is the name of the WissKI you want to you want to connect to.
From a linux (or mac, or windows 11) command line you may use:
ssh -J ${DOMAIN}:2222 www-data@${HOSTNAME}
ssh -J ${DOMAIN}:${PORT} www-data@${HOSTNAME}
You may also place the following into your $HOME/.ssh/config file:
@ -44,7 +45,7 @@ Host *.${DOMAIN}
Host ${DOMAIN}.proxy
User www-data
Hostname ${DOMAIN}
Port 2222
Port ${PORT}
and then connect simply via:
@ -81,6 +82,7 @@ func (ssh2 *SSH2) handleConnection(session ssh.Session) {
{"${SLUG}", slug},
{"${DOMAIN}", ssh2.Config.DefaultDomain},
{"${HOSTNAME}", slug + "." + ssh2.Config.DefaultDomain},
{"${PORT}", strconv.FormatUint(uint64(ssh2.Config.PublicSSHPort), 10)},
} {
banner = strings.ReplaceAll(banner, oldnew[0], oldnew[1])
}