{"id":1102,"date":"2014-10-07T10:49:04","date_gmt":"2014-10-07T02:49:04","guid":{"rendered":"https:\/\/cowman-chiang.no-ip.org\/wordpress\/?p=1102"},"modified":"2023-10-31T15:45:59","modified_gmt":"2023-10-31T07:45:59","slug":"ssh-%e7%99%bb%e5%85%a5%e6%99%82%e5%af%84%e7%99%bc%e9%80%9a%e7%9f%a5%e4%bf%a1%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/cowmanchiang.me\/wp\/?p=1102","title":{"rendered":"SSH \u767b\u5165\u6642\u5bc4\u767c\u901a\u77e5\u4fe1\u4ef6"},"content":{"rendered":"<p>vim ~\/.bashrc<\/p>\n<p>echo &#8216;ALERT &#8211; Shell Access (WP) on:&#8217; <code>date<\/code> <code>who<\/code> | mailx -A gmail -s &#8220;Alert: Shell Access from <code>who | cut -d'(' -f2 | cut -d')' -f1<\/code>&#8221; cowman.chiang@gmail.com > \/dev\/null 2>&amp;1<\/p>\n<p>\u642d\u914d <a href=\"?p=1100\" title=\"\u4f7f\u7528GMail SMTP\u5bc4\u4fe1\">\u4f7f\u7528GMail SMTP\u5bc4\u4fe1<\/a> \u9019\u4e00\u7bc7\u9032\u884c<br \/>\n\u5176\u4e2d > \/dev\/null 2>&amp;1 \u662f\u4e0d\u60f3\u8b93\u4f7f\u7528\u8005\u4e00\u767b\u5165\u5c31\u51fa\u73fe\u6709warning issue\u7684\u4e8b\u4ef6&#8230;\u9084\u6c92\u60f3\u5230\u600e\u9ebc\u89e3\u6c7a~\u5148\u8b93\u932f\u8aa4\u8a0a\u606f\u6d88\u5931&#8230;<\/p>\n<p>Reference : <a href=\"http:\/\/www.tecmint.com\/get-root-ssh-login-email-alerts-in-linux\/\" title=\"How to Get Root and User SSH Login Email Alerts\" target=\"_blank\" rel=\"noopener noreferrer\">How to Get Root and User SSH Login Email Alerts<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>vim ~\/.bashrc echo &#8216;ALERT &#8211; Shell Access (WP) on:&#8217; date who | mailx -A gmail -s &#8220;Alert: Shell Access from who | cut -d'(&#8216; -f2 | cut -d&#8217;)&#8217; -f1&#8221; cowman.chiang@gmail.com > \/dev\/null 2>&amp;1 \u642d\u914d \u4f7f\u7528GMail SMTP\u5bc4\u4fe1 \u9019\u4e00\u7bc7\u9032\u884c \u5176\u4e2d > \/dev\/null &hellip; <a href=\"https:\/\/cowmanchiang.me\/wp\/?p=1102\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-1102","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1102"}],"version-history":[{"count":1,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1102\/revisions"}],"predecessor-version":[{"id":2004,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1102\/revisions\/2004"}],"wp:attachment":[{"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cowmanchiang.me\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}