{"id":1758,"date":"2021-09-08T11:52:46","date_gmt":"2021-09-08T11:52:46","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1758"},"modified":"2021-09-08T11:52:46","modified_gmt":"2021-09-08T11:52:46","slug":"get-an-email-alert-when-somebody-logs-in-as-root","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/","title":{"rendered":"Get an Email Alert when Somebody Logs in as Root"},"content":{"rendered":"<h2>How to setup an Email alert once someone has logged into your server as root?<\/h2>\n<p>It is advised to set an email alert once someone gets logged into your server via. SSH\/root.<\/p>\n<p>You need to form amendments to the .bashrc that&#8217;s offered underneath the \u2018\/root\u2019 partition. This file could be a hidden, thus you need to use the -a flag with ls command to look at all the hidden files.<\/p>\n<p>Then add the below code to the bottom of the existing code :<\/p>\n<blockquote><p><strong><em>echo \u2018SSH Root Access (<\/em>Your Server Name<em>) on:\u2019 `date` `who` | mail -s<\/em><\/strong><\/p>\n<p><strong><em> \u201cALERT: Root Access from `who | cut -d\u201d(\u201d -f2 | cut -d\u201d)\u201d -f1`\u201d\u00a0<\/em><em>your@emailaddress.com<\/em><\/strong><\/p><\/blockquote>\n<p>NOTE: We suggest you :<\/p>\n<ul>\n<li>Not to alter root logins over SSH.<\/li>\n<li>Also, it&#8217;s helpful to use an email address that isn\u2019t hosted on a similar server from which the notifications would be sent.<\/li>\n<li>This procedure is appropriate just for those customers who have an SSH access i.e.. with VPS Hosting, Cloud Hosting, Semi-Dedicated Servers and Dedicated Hosting Servers.<\/li>\n<\/ul>\n<p>This procedure ought to be useful to all the customers who have servers with multiple administrators or have to give an SSH access to someone on an everyday basis. Here again, we might stress on limiting the disclosure of the Root password and keeping it to minimum. Further, we might prefer to encourage you to alter it on an everyday basis.<\/p>\n<p>Though, the mentioned procedure wouldn&#8217;t facilitate if somebody tries to hack into your server using the newest kernel exploit, due to the fundamental fact that, the hacker would produce a unique SSH or telnet affiliation. Inorder to protect your server from such activities, you need to keep your server updated, get a firewall installed and adopt the updated security releases.<\/p>\n<p>You must re-check if the modifications are operating fine. If you face a difficulty with this and need any assistance, please contact our 24\u00d77 Linux operating system Technical Support Team either via. Live Chat or raise a price ticket at the service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to setup an Email alert once someone has logged into your server as root? It is advised to set an email alert once someone gets logged into your server via. SSH\/root. You need to form amendments to the .bashrc that&#8217;s offered underneath the \u2018\/root\u2019 partition. This file could be a hidden, thus you need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1758","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get an Email Alert when Somebody Logs in as Root - OWS KB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get an Email Alert when Somebody Logs in as Root - OWS KB\" \/>\n<meta property=\"og:description\" content=\"How to setup an Email alert once someone has logged into your server as root? It is advised to set an email alert once someone gets logged into your server via. SSH\/root. You need to form amendments to the .bashrc that&#8217;s offered underneath the \u2018\/root\u2019 partition. This file could be a hidden, thus you need [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-08T11:52:46+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\",\"name\":\"Get an Email Alert when Somebody Logs in as Root - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-09-08T11:52:46+00:00\",\"dateModified\":\"2021-09-08T11:52:46+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/get-an-email-alert-when-somebody-logs-in-as-root\/\",\"name\":\"Get an Email Alert when Somebody Logs in as Root\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1758"}],"version-history":[{"count":1,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1758\/revisions"}],"predecessor-version":[{"id":1759,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1758\/revisions\/1759"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}