Slide 49
Slide 49 text
Wish: keyboard interactive auth
srv, err :" wish.NewServer(
/$ ..&
wish.WithKeyboardInteractiveAuth(func(_ ssh.Context, ch gossh.KeyboardInteractiveChallenge) bool {
log.Info("keyboard-interactive")
answers, err :" ch(
"Welcome to my server!", "Please answer these questions:",
[]string{
"♦ How much is 2+3: ",
"♦ Which editor is best, vim or emacs? ",
"♦ Tell me your best secret: ",
},
[]bool{true, true, false},
)
if err !+ nil {
return false
}
return len(answers) =- 3 &/ answers[0] =- "5" &/
answers[1] =- "vim" &/ answers[2] !+ ""
}),
/$ ..&
)
49 Carlos Becker - Gophercon Latam 2025