diff --git a/ee/consoleuser/consoleuser_linux.go b/ee/consoleuser/consoleuser_linux.go index b230a90c7..0b1986a0d 100644 --- a/ee/consoleuser/consoleuser_linux.go +++ b/ee/consoleuser/consoleuser_linux.go @@ -13,9 +13,10 @@ import ( ) type listSessionsResult []struct { - Session string `json:"session"` - UID int `json:"uid"` - Seat string `json:"seat"` + Session string `json:"session"` + UID int `json:"uid"` + Username string `json:"user"` + Seat string `json:"seat"` } func CurrentUids(ctx context.Context) ([]string, error) { @@ -36,8 +37,9 @@ func CurrentUids(ctx context.Context) ([]string, error) { var uids []string for _, s := range sessions { - // generally human users start at 1000 on linux - if s.UID < 1000 { + // generally human users start at 1000 on linux. 65534 is reserved for https://wiki.ubuntu.com/nobody, + // which we don't want to count as a current user. + if s.UID < 1000 || s.UID == 65534 || s.Username == "nobody" { continue }