Any way to cut the systemd verbosity in this scenario?

I have two openSUSE 13.2 i586 (32-bit) systems. From a script, one system logs into the second system using ssh and pre-shared key to the other system with a command invocation on the ssh command. Something like this:

ssh -l myuserid@othersystem "blah-command-here"

This ssh invocation happens about 100 times from the script. On the othersystem, I see this for each and every ssh login that occurs:

sshd[8316]: Accepted publickey for myuserid from 192.168.xxx.xxx port 36048 ssh2: RSA <masked> [MD5]
 sshd[8316]: pam_unix(sshd:session): session opened for user myuserid by (uid=0)
 systemd[1]: Starting user-1000.slice.
 systemd[1]: Created slice user-1000.slice.
 systemd[1]: Starting User Manager for UID 1000...
 systemd[1]: Starting Session 153 of user myuserid.
 systemd[1]: Started Session 153 of user myuserid.
 systemd: pam_unix(systemd-user:session): session opened for user myuserid by (uid=0)
 systemd-logind[1551]: New session 153 of user myuserid.
 systemd[8318]: Starting Paths.
 systemd[8318]: Reached target Paths.
 systemd[8318]: Starting Timers.
 systemd[8318]: Reached target Timers.
 systemd[8318]: Starting Sockets.
 systemd[8318]: Reached target Sockets.
 systemd[8318]: Starting Basic System.
 systemd[8318]: Reached target Basic System.
 systemd[8318]: Starting Default.
 systemd[8318]: Reached target Default.
 systemd[8318]: Startup finished in 241ms.
 systemd[1]: Started User Manager for UID 1000.
 sshd[8320]: Received disconnect from 192.168.xxx.xxx: 11: disconnected by user
 sshd[8316]: pam_unix(sshd:session): session closed for user myuserid
 systemd-logind[1551]: Removed session 153.
 systemd[1]: Stopping User Manager for UID 1000...
 systemd[8318]: Stopping Default.
 systemd[8318]: Stopped target Default.
 systemd[8318]: Stopping Basic System.
 systemd[8318]: Stopped target Basic System.
 systemd[8318]: Stopping Paths.
 systemd[8318]: Stopped target Paths.
 systemd[8318]: Stopping Timers.
 systemd[8318]: Stopped target Timers.
 systemd[8318]: Stopping Sockets.
 systemd[8318]: Stopped target Sockets.
 systemd[8318]: Starting Shutdown.
 systemd[8318]: Reached target Shutdown.
 systemd[8318]: Starting Exit the Session...
 systemd[8318]: Received SIGRTMIN+24 from PID 8353 (kill).
 systemd: pam_unix(systemd-user:session): session closed for user myuserid
 systemd[1]: Stopped User Manager for UID 1000.
 systemd[1]: Stopping user-1000.slice.
 systemd[1]: Removed slice user-1000.slice.

Is there a way to make systemd stop telling me the same set of useless things over, and over, and over… just because someone logged in legitimately to the system?

If it matters:


# systemctl --version
systemd 210
+PAM -LIBWRAP +AUDIT +SELINUX -IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ +SECCOMP +APPARMOR

# rpm -qa | grep systemd
systemd-rpm-macros-2-8.1.2.noarch
systemd-presets-branding-openSUSE-0.3.0-12.7.1.noarch
systemd-bash-completion-210.1456152170.f2b9ea6-25.34.1.noarch
systemd-sysvinit-210.1456152170.f2b9ea6-25.34.1.i586
util-linux-systemd-2.25.1-20.1.i586
systemd-210.1456152170.f2b9ea6-25.34.1.i586

# uname -a
Linux my-node 3.16.7-35-desktop #1 SMP PREEMPT Sun Feb 7 17:32:21 UTC 2016 (832c776) i686 i686 i386 GNU/Linux

Not really. You can deactivate systemd user instances by masking user@.service; this will prevent spawning of per-user systemd and associated messages. User systemd are still basically unused to my best knowledge. To completely get rid of those messages you would need to change PAM configuration and remove pam_systemd; but this could have unforseen effects. If you will do it, then it is best to configure separate ssh daemon used only for non-interactive logons with own PAM configuration.

I tried that at one time. It broke “polkit”.

That is disappointing to read that there may be no way to suppress or reduce those messages. Nobody needs 43 lines of stuff like that per login written to the syslog.

If your script is accessing the other machine so many times,
Is it worth the effort to keep the ssh session open and re-use the connection when you need to run the command?

There is generally some nexus where it’s less expensive to keep logging in again and again vs. keeping the session open. Your machines will probably perform better since authentication is usually very expensive.

It’s a common situation where something becomes so bothersome that you should ask yourself whether you’re realy doing it “the right way.”

TSU

Excellent question. After some readings, it looks like some inclusion (exacts still to be determined) of the ssh options ControlMaster, ControlPath, and ControlPersist should work to keep systemd from being so verbose as my script connects so many times.