Skip to content

Commit

Permalink
docs: fix example comment
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 15, 2025
1 parent 43884f7 commit 17b07b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/multi-auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func main() {
// You can SSH into the server like so:
// ssh -o PreferredAuthentications=none -p 23234 localhost
// ssh -o PreferredAuthentications=password -p 23234 localhost
// ssh -o PreferredAuthentications=public-key -p 23234 localhost
// ssh -o PreferredAuthentications=publickey -p 23234 localhost
// ssh -o PreferredAuthentications=keyboard-interactive -p 23234 localhost

// First, public-key authentication:
wish.WithPublicKeyAuth(func(_ ssh.Context, key ssh.PublicKey) bool {
log.Info("public-key")
log.Info("publickey")
for _, pubkey := range users {
parsed, _, _, _, _ := ssh.ParseAuthorizedKey(
[]byte(pubkey),
Expand Down Expand Up @@ -87,6 +87,7 @@ func main() {
func(next ssh.Handler) ssh.Handler {
return func(sess ssh.Session) {
wish.Println(sess, "Authorized!")
wish.Println(sess, sess.PublicKey())
}
},
),
Expand Down

0 comments on commit 17b07b5

Please sign in to comment.