logind: does it work for ssh connections?

I was looking at my logind charts and they always show values of zero.
I only ever connect via ssh; is this expected behaviour?

@Luis_Johnstone : ssh connections will show up on logind module in the logind.sessions as “remote” sessions and logind.sessions_type chart as “console” connections unless some auth configurations are modified on the system.
Can you check if these are being reported?

hi @sashwathn many thanks for the reply! It’s really bizarre but it’s started working; very odd as I’d been waiting about an hour… oh well! :slight_smile:

Now that I can see data I’m a bit confused by it:

My sessions are over ssh and so how can they be local as opposed to remote?

I don’t think this is a technical issue at this point but more of a concern about what the purpose of these charts is supposed to be. I had assumed that I’d be able to see (identify) how many users were connected over ssh vs locally logged on etc.

Hi, @Luis_Johnstone. The logind collector gathers information by querying the systemd login manager.

It gets the same info (doing the same calls) as you get when using loginctl:

  • loginctl list-sessions
  • loginctl show-session SESSION (for every session)
  • loginctl list-users
  • loginctl show-user USER (for every user)

See the list of properties for SESSION and USER objects (search for Session Objects and User Objects headers).

Remote encodes whether the session is local or remote.

Remote vs Local counters - as reported by the systemd logind manager - there is Remote property (true/false values).


If you have any ideas on how we can improve the collector (knowing the information that is available) - your suggestions are welcome!

Connected to my VM via SSH 3 times and I get 3 remote sessions and 1 user (which is correct):

@ilyam8 Thanks very much for that! It helped me figure out what was going on.
Geez, looks like a systemd bug.
When I run the users command it shows all my logins but loginctl doesn’t show them.