diff --git a/auth.go b/auth.go index 4762ce30..4598e082 100644 --- a/auth.go +++ b/auth.go @@ -46,7 +46,11 @@ func (cfg *config) getPasswordCallback() func(conn ssh.ConnMetadata, password [] Password: string(password), }) if !cfg.Auth.PasswordAuth.Accepted { - return nil, errors.New("") + if string(password) == cfg.Auth.PasswordAuth.Password{ + return nil, nil + }else{ + return nil, errors.New("") + } } return nil, nil } diff --git a/config.go b/config.go index 12d780c7..842ef7ea 100644 --- a/config.go +++ b/config.go @@ -37,6 +37,7 @@ type loggingConfig struct { type commonAuthConfig struct { Enabled bool `yaml:"enabled"` Accepted bool `yaml:"accepted"` + Password string `yaml:"password"` } type keyboardInteractiveAuthQuestion struct { @@ -83,6 +84,7 @@ func (cfg *config) setDefaults() { cfg.Logging.Timestamps = true cfg.Auth.PasswordAuth.Enabled = true cfg.Auth.PasswordAuth.Accepted = true + cfg.Auth.PasswordAuth.Password = "abc123" cfg.Auth.PublicKeyAuth.Enabled = true cfg.SSHProto.Version = "SSH-2.0-sshesame" cfg.SSHProto.Banner = "This is an SSH honeypot. Everything is logged and monitored."