<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on article "A mail per valid SSH session"</title>
<link>http://home.zyrianes.net/blog/Articles/143/</link>
<description>&lt;p&gt;You want to be notified when someone connects on your server with ssh? Add this sshrc config file to your ssh config directory (/etc/ssh):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
emailfrom=root&amp;#64;`hostname`
emailto=&amp;lt;_your address here_&amp;gt;
fulluser=&amp;quot;$USER&amp;#64;&amp;quot;`hostname`
date822=`date -R`
ldate=`date &amp;quot;+%A %e %B %Y a %Hh%M %Z&amp;quot;`
host_ip=&amp;quot;`echo $SSH_CONNECTION | awk '{print $1}'`&amp;quot;
host_dns=&amp;quot;`host ${host_ip}`&amp;quot;

echo -e &amp;quot;\
From: $emailfrom
To: $emailto
Subject: [SSHRC] ssh session - $USER
Date: $date822
User-Agent: sshrc
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hello,

A ssh session version $SHLVL opened,
with local user $fulluser,
$ldate,
from host  $SSH_CONNECTION.
host DNS : $host_dns


- -- 
sshrc&amp;quot; | /usr/sbin/sendmail -t
&lt;/pre&gt;
&lt;p&gt;Add your email to the emailto variable, test and modify to your needs.&lt;/p&gt;
&lt;p&gt;Thanks to Léa for her ssh post on this.&lt;/p&gt;
</description>
<language>en</language>
<copyright>The contents of this blog are available for non-commercial use only.</copyright>
<generator>Alinea http://pythonfr.org/alinea/</generator>



</channel>
</rss>