Skip to content

Commit 622c93a

Browse files
committed
chore(ssh): add public key as field on auth loggin
1 parent 43b5111 commit 622c93a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ssh/server/auth/publickey.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
gliderssh "github.com/gliderlabs/ssh"
77
"github.com/shellhub-io/shellhub/ssh/session"
88
log "github.com/sirupsen/logrus"
9+
"golang.org/x/crypto/ssh"
910
)
1011

1112
// PublicKeyHandler handles ShellHub client's connection using the public key authentication method.
@@ -14,6 +15,7 @@ func PublicKeyHandler(ctx gliderssh.Context, publicKey gliderssh.PublicKey) bool
1415
log.Fields{
1516
"uid": ctx.SessionID(),
1617
"sshid": ctx.User(),
18+
"key": ssh.MarshalAuthorizedKey(publicKey),
1719
})
1820

1921
logger.Trace("trying to use public key authentication")

0 commit comments

Comments
 (0)