<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>login — LowEndSpirit</title>
        <link>https://staging.lowendspirit.com/index.php?p=/</link>
        <pubDate>Sat, 11 Apr 2026 10:48:53 +0000</pubDate>
        <language>en</language>
            <description>login — LowEndSpirit</description>
    <atom:link href="https://staging.lowendspirit.com/index.php?p=/discussions/tagged/login/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Email notification when someone logs in via SSH</title>
        <link>https://staging.lowendspirit.com/index.php?p=/discussion/3927/email-notification-when-someone-logs-in-via-ssh</link>
        <pubDate>Mon, 03 May 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>mikho</dc:creator>
        <guid isPermaLink="false">3927@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://staging.lowendspirit.com/index.php?p=/profile/mikho" rel="nofollow">@mikho</a>, 3 May 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/kl/ovtru2uav7gg.png" alt="image" />
</p>

<p>Even if it is too late when someone else logs in as root on your server, it is good to know that <strong>NOW</strong> is the time to get working on your security.</p>

<p>To setup email notification, login to your server as root.<br />
Edit .bashrc</p>

<pre><code>editor .bashrc
</code></pre>

<p>add the following line at the end, changing “ServerName” to the hostname of your server and “email@thisaddress.com” to your own email address.</p>

<pre><code>echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" email@thisaddress.com 
</code></pre>

<hr />

<p><strong>!NOTE!</strong> - Take notice of the &#96; in the code block. Sometimes when copying code from a webpage, these small characters will mess up when pasted.</p>

<hr />

<p>Save and exit your .bashrc.</p>

<p>Next time someone, hopefully you, logs on as root, you will get an email about this.</p>

<p>This can be done for any user, you only have to make sure that the user can email out from your server.</p>

<p>Quick Tip: Use the guide <a rel="nofollow" href="https://lowendspirit.com/low-memory-usage-smtp-send-only/">here</a> to install and configure a Low Resource SMTP Server.</p>
]]>
        </description>
    </item>
   </channel>
</rss>
