File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,13 @@ func HostKeyFile(filepath string) Option {
42
42
}
43
43
}
44
44
45
+ func KeyboardInteractiveAuth (fn KeyboardInteractiveHandler ) Option {
46
+ return func (srv * Server ) error {
47
+ srv .KeyboardInteractiveHandler = fn
48
+ return nil
49
+ }
50
+ }
51
+
45
52
// HostKeyPEM returns a functional option that adds HostSigners to the server
46
53
// from a PEM file as bytes.
47
54
func HostKeyPEM (bytes []byte ) Option {
Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ func (srv *Server) config(ctx Context) *gossh.ServerConfig {
124
124
for _ , signer := range srv .HostSigners {
125
125
config .AddHostKey (signer )
126
126
}
127
- if srv .PasswordHandler == nil && srv .PublicKeyHandler == nil {
127
+ if srv .PasswordHandler == nil && srv .PublicKeyHandler == nil && srv . KeyboardInteractiveHandler == nil {
128
128
config .NoClientAuth = true
129
129
}
130
130
if srv .Version != "" {
You can’t perform that action at this time.
0 commit comments