Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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."
Expand Down