fallback to none when public key failed
This commit is contained in:
parent
4bdab7516b
commit
65bbc172d8
1 changed files with 3 additions and 2 deletions
|
|
@ -157,8 +157,9 @@ func findUpstreamFromUserfile(conn ssh.ConnMetadata) (net.Conn, *ssh.SSHPiperAut
|
|||
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (ssh.AuthPipeType, ssh.AuthMethod, error) {
|
||||
signer, err := mapPublicKeyFromUserfile(conn, key)
|
||||
|
||||
if err != nil {
|
||||
return ssh.AuthPipeTypeDiscard, nil, err
|
||||
if err != nil || signer == nil {
|
||||
// try one
|
||||
return ssh.AuthPipeTypeNone, nil, nil
|
||||
}
|
||||
|
||||
return ssh.AuthPipeTypeMap, ssh.PublicKeys(signer), nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue