3

Debian 10

I have a lot of log info like this:

localhost systemd[1]: Started Session 30522 of user xxxx.

How can I stop sshd to send logging info to sysconf ?

Thank you


I reproduced what the suggested link provided but it did not work for me. This is what I did:

I added a file in the /etc/rsyslog.d directory In this file I put the following command:

if $programname == "systemd" and ($msg contains "Removed session" or $msg contains "New session" or $msg contains "session-" or $msg contains "Started Session") then stop

I relaunched rsyslog:

systemctl restart rsyslog

but I still have, for example, Started Session 9999 of user foot in syslog file.

roaima
  • 107,089
  • 14
  • 139
  • 261
PatriceJ
  • 41
  • 2
  • 2
    Does this answer your question? [System log full of session and slice messages](https://unix.stackexchange.com/questions/267965/system-log-full-of-session-and-slice-messages) – αғsнιη Oct 29 '21 at 14:21
  • 1
    (its not ssh server generating those log entrie, its systemd) – symcbean Feb 17 '22 at 01:31

1 Answers1

1

It's not sshd generating those logs. These are low priority "info"-level messages related to session and resource management by systemd.

This can be prevented by typing the following in the shell:

$ systemd-analyze set-log-level notice

But you can also set the log level and/or filter the messages in rsyslog, for that see the following link: System log full of session and slice messages (provided in comments by @afshin).

eDonkey
  • 150
  • 8