Fix ipv6 parsing for builtin ssh server (#17561)
This commit is contained in:
parent
5e0cf4b82e
commit
bd613c704c
3 changed files with 9 additions and 3 deletions
|
@ -17,6 +17,7 @@ import (
|
|||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
@ -264,7 +265,7 @@ func sshConnectionFailed(conn net.Conn, err error) {
|
|||
// Listen starts a SSH server listens on given port.
|
||||
func Listen(host string, port int, ciphers []string, keyExchanges []string, macs []string) {
|
||||
srv := ssh.Server{
|
||||
Addr: fmt.Sprintf("%s:%d", host, port),
|
||||
Addr: net.JoinHostPort(host, strconv.Itoa(port)),
|
||||
PublicKeyHandler: publicKeyHandler,
|
||||
Handler: sessionHandler,
|
||||
ServerConfigCallback: func(ctx ssh.Context) *gossh.ServerConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue