--- a/ssh/server.go Tue Sep 10 02:11:53 2019 -0500
+++ b/ssh/server.go Tue Sep 10 02:22:13 2019 -0500
@@ -57,7 +57,12 @@
- log.Infof("new ssh connection from %s(%s)", sshConn.RemoteAddr(), sshConn.ClientVersion())
+ "new ssh connection for %s from %s(%s)", + sshConn.Permissions.Extensions["username"], + sshConn.ClientVersion(), go ssh.DiscardRequests(reqs)
@@ -67,12 +72,15 @@
func (s *Server) publicKeyCallback(meta ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
username, err := access.UsernameFromPubkey(key)
- log.Infof("username: %q; err %v", username, err)
- log.Infof("returning username: %q", username)
+ "%q authenticated with %s", + ssh.FingerprintSHA256(key), Extensions: map[string]string{"username": username},
@@ -101,6 +109,8 @@
// now run through all of the requests but only handle shell requests
for req := range requests {
+ username := serverConn.Permissions.Extensions["username"] // this is garbage, but payload is a pascal string where the
@@ -110,7 +120,12 @@
rawCmd := string(req.Payload[4:])
- log.Infof("%s requested command %q", serverConn.RemoteAddr(), rawCmd)
+ "%s@%s requested command %q", + serverConn.RemoteAddr(), cmd, err := commands.Find(rawCmd, s.reposPath)
@@ -120,16 +135,33 @@
- username := serverConn.Permissions.Extensions["username"]
- log.Infof("username in exec: %q", username)
if err := cmd.Run(conn, serverConn, username, req); err != nil {
- log.Warnf("%s command %q failed: %v", serverConn.RemoteAddr(), rawCmd, err)
+ "%s@%s command %q failed: %v", + serverConn.RemoteAddr(), + "%s@%s command %q succeed", + serverConn.RemoteAddr(), - log.Debugf("%s unsupported request: %q", serverConn.RemoteAddr(), req.Type)
+ "%s@%s unsupported request: %q", + serverConn.RemoteAddr(),