{"id":247,"date":"2016-07-10T19:26:11","date_gmt":"2016-07-10T19:26:11","guid":{"rendered":"http:\/\/memo.xtranet.info\/?p=247"},"modified":"2016-07-10T19:26:47","modified_gmt":"2016-07-10T19:26:47","slug":"ssh-envoie-de-mail-lors-dune-connexion","status":"publish","type":"post","link":"https:\/\/memo.xtranet.info\/?p=247","title":{"rendered":"SSH envoie de mail lors d&rsquo;une connexion !!"},"content":{"rendered":"<h1><span style=\"color: #ff9900;\">SSH envoie de mail lors d&rsquo;une connexion !!<\/span><\/h1>\n<p>Pour avoir un mail d&rsquo;avertissement lors d&rsquo;une ouverture de session ssh sur un serveur, il suffit :<\/p>\n<ul>\n<li>D&rsquo;\u00e9diter le fichier <span style=\"color: #ff9900;\">.<\/span><strong title=\"\/home\/gilles\/.bashrc\"><span style=\"color: #ff9900;\">bashrc<\/span> en ajoutant et en adaptant la ligne suivante : <\/strong>\n<ul>\n<li>echo &lsquo;Acces Shell de <span style=\"color: #00ff00;\">Nom_Utilisateur<\/span> <span style=\"color: #00ff00;\">Nom_du_Serveur<\/span> le &lsquo; `date` `who` | mail -s `hostname` Shell Root de `who | cut -d\u00a0\u00bb(\u00a0\u00bb -f2 | cut -d\u00a0\u00bb)\u00a0\u00bb -f1` <span style=\"color: #00ff00;\">Adresse_mail_destinataire<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>SSH envoie de mail lors d&rsquo;une connexion !! Pour avoir un mail d&rsquo;avertissement lors d&rsquo;une ouverture de session ssh sur un serveur, il suffit : D&rsquo;\u00e9diter le fichier .bashrc en ajoutant et en adaptant la ligne suivante : echo &lsquo;Acces Shell de Nom_Utilisateur Nom_du_Serveur le &lsquo; `date` `who` | mail -s `hostname` Shell Root de&#8230; <a href=\"https:\/\/memo.xtranet.info\/?p=247\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SSH envoie de mail lors d&rsquo;une connexion !!<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,4,24,28,33],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-administration","category-linux","category-monitoring","category-securite","category-ssh"],"_links":{"self":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=247"}],"version-history":[{"count":2,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":249,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions\/249"}],"wp:attachment":[{"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/memo.xtranet.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}