Add more debug logging

This commit is contained in:
Russell Ballestrini 2025-12-21 09:50:11 -05:00
parent f127c624c0
commit 5370758c30

View file

@ -193,6 +193,8 @@ func (p *SkelPlugin) PasswordCallback(conn libplugin.ConnMetadata, password []by
}
func (p *SkelPlugin) PublicKeyCallback(conn libplugin.ConnMetadata, publicKey []byte) (*libplugin.Upstream, error) {
log.Infof("PublicKeyCallback called for user %s, key len=%d", conn.User(), len(publicKey))
pubKey, err := ssh.ParsePublicKey(publicKey)
if err != nil {
return nil, err
@ -272,11 +274,13 @@ func (p *SkelPlugin) PublicKeyCallback(conn libplugin.ConnMetadata, publicKey []
}
// Pass the client's public key so their fingerprint can be included in the upstream username
log.Infof("Creating upstream with client key len=%d", len(publicKey))
u, err := p.createUpstreamWithClientKey(conn, to, nil, publicKey)
if err != nil {
return nil, err
}
log.Infof("Upstream created with username=%s", u.UserName)
return u, nil
}