Send key correctly; don't retry 4xx errors

This commit is contained in:
DaneEveritt
2022-05-15 16:17:06 -04:00
parent 5bcf4164fb
commit 1927a59cd0
2 changed files with 5 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ func (c *SFTPServer) Run() error {
return c.makeCredentialsRequest(conn, remote.SftpAuthPassword, string(password))
},
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
return c.makeCredentialsRequest(conn, remote.SftpAuthPublicKey, string(key.Marshal()))
return c.makeCredentialsRequest(conn, remote.SftpAuthPublicKey, string(ssh.MarshalAuthorizedKey(key)))
},
}
conf.AddHostKey(private)