title: How can I listen for and report server (SSH) connections via a Python script?
body: <p>I am a bit new to Python, but an experienced programmer. I am writing a Python 2.7 script which should be started by a Linux server at boot. The purpose is to send, via various mediums, notification(s) when a user connects to the server.</p>
  
  <p>My problem has to do with the actual listening. How can I make the module see when a user connects (via SSH, or whatever) to the server? Some quick pseudocode:</p>
  
  <pre><code># When a connection is made
      # Send an email
      # Send a text message
      # Send notification to server output
      # Etc...
  </code></pre>
  
  <p><em>I'd like to include some details in the notification, like username, IP, connection time, last connection, a cute custom connection message, whatever. Any protips on how to do those things best is appreciated as well, but I'm sure I can figure this out elsewhere.</em></p>
  
  <p>Thanks in advance for any guidance!</p>