File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ type Server struct {
15
15
Addr string // TCP address to listen on, ":22" if empty
16
16
Handler Handler // handler to invoke, ssh.DefaultHandler if nil
17
17
HostSigners []Signer // private keys for the host key, must have at least one
18
+ Version string // server version to be sent before the initial handshake
18
19
19
20
PasswordHandler PasswordHandler // password authentication handler
20
21
PublicKeyHandler PublicKeyHandler // public key authentication handler
@@ -37,6 +38,9 @@ func (srv *Server) makeConfig() (*gossh.ServerConfig, error) {
37
38
if srv .PasswordHandler == nil && srv .PublicKeyHandler == nil {
38
39
config .NoClientAuth = true
39
40
}
41
+ if srv .Version != "" {
42
+ config .ServerVersion = "SSH-2.0-" + srv .Version
43
+ }
40
44
if srv .PasswordHandler != nil {
41
45
config .PasswordCallback = func (conn gossh.ConnMetadata , password []byte ) (* gossh.Permissions , error ) {
42
46
perms := & gossh.Permissions {}
You can’t perform that action at this time.
0 commit comments