{"id":77,"date":"2014-09-29T01:29:33","date_gmt":"2014-09-28T19:59:33","guid":{"rendered":"http:\/\/bhuvan.wordpress.com\/?p=77"},"modified":"2014-09-29T01:29:33","modified_gmt":"2014-09-28T19:59:33","slug":"single-line-to-send-an-alert-mail-from-shell","status":"publish","type":"post","link":"https:\/\/www.bhuvankrishna.in\/blog\/2014\/09\/29\/single-line-to-send-an-alert-mail-from-shell\/","title":{"rendered":"Single line to send an alert mail from shell"},"content":{"rendered":"<p>The power of shell and how simple it is to send a mail when every some one logs in as root to a predefined email.<\/p>\n<p>echo &#8216;ALERT &#8211; Root Shell Access (message or DNS) on:&#8217; `date` `who` | mail -s &#8220;Alert: Root Access from `who | cut -d&#8221;(&#8221; -f2 | cut -d&#8221;)&#8221; -f1`&#8221; &lt;email id&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The power of shell and how simple it is to send a mail when every some one logs in as root to a predefined email. echo &#8216;ALERT &#8211; Root Shell Access (message or DNS) on:&#8217; `date` `who` | mail -s &#8220;Alert: Root Access from `who | cut -d&#8221;(&#8221; -f2 | cut -d&#8221;)&#8221; -f1`&#8221; &lt;email id&gt;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":0,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bhuvankrishna.in\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}