Tuesday 23 January 2018

User session messages in the system log on Centos 7

Here's how to get rid of those annoying systemd messages that flood /var/log/messages on Centos 7.

Filter them out with an rsyslog filter script in /etc/rsyslog.d -

echo 'if $programname == "systemd" and ($msg contains "Starting Session" or $msg contains "Started Session" or $msg contains "Created slice" or $msg contains "Starting user-" or $msg contains "Starting User Slice of" or $msg contains "Removed session" or $msg contains "Removed slice User Slice of" or $msg contains "Stopping User Slice of") then stop' >/etc/rsyslog.d/ignore-systemd-session-slice.conf

Then restart rsyslog

systemctl restart rsyslog

Shamelessly stolen from Red Hat here

Thursday 11 January 2018

Useful commands to check SSL certs

Here's some useful stuff to examine SSL certs.
I've pulled some of this from here

Check a key
  • openssl rsa -in key.file -check
  • openssl ec -in key.file (For an EC cert)
Check a cert

  • openssl x509 -in cert.file -text -noout
 Test an SSL connection
  • openssl s_client -connect some.site.com:443
  • openssl s_client -connect some.site.com:443 -servername some.site.com
    (If website uses SNI)