{"id":3343,"date":"2023-03-10T22:46:55","date_gmt":"2023-03-10T21:46:55","guid":{"rendered":"https:\/\/www.gcportal.com\/wordpress\/?p=3343"},"modified":"2023-03-14T11:50:29","modified_gmt":"2023-03-14T10:50:29","slug":"welcome-message-postautenticazione-ssh","status":"publish","type":"post","link":"https:\/\/www.gcportal.com\/wordpress\/archives\/3343","title":{"rendered":"Welcome Message PostAutenticazione SSH"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Per le distribuzioni derivate da UBUNTU<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Per personalizzare il Welcome Message che appare dopo l&#8217;avvenuta autenticazione SSH, procedi come segue:<br>Apri un terminale e digita i seguenti comandi:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color\">$ sudo apt update<\/mark><\/strong><br><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color has-black-color\">$ sudo apt install toilet<\/mark><\/strong>   (<a rel=\"noreferrer noopener\" href=\"https:\/\/delightlylinux.wordpress.com\/2015\/11\/13\/colored-text-with-toilet\/\" target=\"_blank\">toilet<\/a> \u00e8 un comando che crea un banner ascii a colori)<br><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color\">$ sudo apt install lm-sensors<\/mark><\/strong> (<a rel=\"noreferrer noopener\" href=\"https:\/\/wiki.ubuntu-it.org\/AmministrazioneSistema\/LmSensors\" target=\"_blank\">lm-sensors<\/a> per tenere sotto controllo le temperature e molto altro) <br><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color has-black-color\">$ sudo gedit \/etc\/update-motd.d\/10-help-text<\/mark><\/strong><br>   oppure<br><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color has-black-color\">$ sudo nano \/etc\/update-motd.d\/10-help-text<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Aggiungi i seguenti comandi allo script. Questo \u00e8 naturalmente la personalizzazione che io ho impostato sul mio server:<\/p>\n\n\n<p>#!\/bin\/sh<br>hostName=`uname -n`<br>diskSpace=`df -Ph | grep sda6 | awk &#8216;{print $1 &#8221; &#8220;$2 &#8221; &#8220;$3 &#8221; &#8220;$4 &#8221; &#8220;$5}&#8217; | tr -d &#8216;\\n&#8217;`<br>memoryUsed=`free -t -m | grep Total | awk &#8216;{print $3&#8243; MB&#8221;;}&#8217;`<br>sensori=`sensors | grep Package | awk &#8216;{print $4&#8243;\u00b0 C&#8221;;}&#8217;`<br>toilet -f mono12 -F metal &#8220;$hostName&#8221;<br>echo<br>echo &#8220;Welcome to Linux Mint&#8221;<br>echo &#8221; * Documentation: http:\/\/www.linuxmint.com&#8221;<br>echo &#8220;<br>====================================================<br>&#8211; Hostname:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $hostName<br>&#8211; Disk Space:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$diskSpace<br>&#8211; Memory used:&nbsp; &nbsp; $memoryUsed<br>&#8211; Temp:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sensori<br>====================================================<br>&#8220;<br>Salva il file (CTRL-X + Salva)<\/p>\n<p>Il risultato sar\u00e0 come visualizzato nella parte alta dell&#8217;immagine sottostante:<\/p>\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"521\" src=\"https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717-800x521.png\" alt=\"\" class=\"wp-image-3302\" srcset=\"https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717-800x521.png 800w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717-300x195.png 300w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717-100x65.png 100w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717-768x500.png 768w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-10_151717.png 1143w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Per le distribuzioni DEBIAN<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Se vuoi personalizzare i warning message puoi farlo modificando il file <strong><em>\/etc\/motd<\/em><\/strong> (motd sta per Message of the day). Questo file contiene il messaggio di benvenuto che appare quando si accede al sistema. Puoi modificare il contenuto di questo file per includere informazioni specifiche o avvisi di sicurezza.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/etc\/motd (Message of the Day)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\/etc\/ssh\/sshd_config: Modificare l&#8217;impostazione PrintLastLog su &#8220;no&#8221;, questo disabiliter\u00e0 il messaggio &#8220;Ultimo accesso&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">a volte, a seconda della personalizzazione, \u00e8 necessario modificare il contenuto di <strong>\/etc\/motd<\/strong>. Sfortunatamente, per impostazione predefinita, <strong>\/etc\/motd<\/strong> \u00e8 un collegamento a <strong>\/var\/run\/motd<\/strong> che viene ripristinato ogni volta che accedi. Per apportare modifiche permanenti al file, procedi come segue:<br><br><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color\">$ sudo rm \/etc\/motd<br>$ sudo nano \/etc\/motd<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quello che segue \u00e8 un esempio preso dalla personalizzazione del mio Zipixel Raspberry Pi4.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">editare il file:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:#fcb900\" class=\"has-inline-color\">$ sudo nano \/etc\/update-motd.d\/10-uname<\/mark><\/strong><\/p>\n\n\n<p>#!\/bin\/sh<br>#uname -snrvm<\/p>\n<p>hostName=`uname -n`<br>diskSpace=`df -Ph | grep root | awk &#8216;{print $1 &#8221; &#8220;$2 &#8221; &#8220;$3 &#8221; &#8220;$4 &#8221; &#8220;$5}&#8217; | tr -d &#8216;\\n&#8217;`<br>memoryUsed=`free -t -m | grep Total | awk &#8216;{print $3&#8243; MB&#8221;;}&#8217;`<br>sensori=`sensors | grep temp1 | awk &#8216;{print $2&#8243;\u00b0 C&#8221;;}&#8217;`<\/p>\n<p>toilet -f mono12 -F metal &#8220;$hostName&#8221;<\/p>\n<p>echo<br>echo &#8220;Welcome to Linux Debian&#8221;<br>echo &#8221; * Documentation: https:\/\/www.raspberryitalia.it\/&#8221;<\/p>\n<p>echo &#8220;<br>====================================================<br>&#8211; Hostname:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $hostName<br>&#8211; Disk Space:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$diskSpace<br>&#8211; Memory used:&nbsp; &nbsp; $memoryUsed<br>&#8211; Temp:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$sensori<br>====================================================<br>&#8220;<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1010\" height=\"802\" src=\"https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730.png\" alt=\"\" class=\"wp-image-3362\" srcset=\"https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730.png 1010w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730-300x238.png 300w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730-800x635.png 800w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730-100x79.png 100w, https:\/\/www.gcportal.com\/wordpress\/wp-content\/uploads\/2023\/03\/2023-03-11_182730-768x610.png 768w\" sizes=\"auto, (max-width: 1010px) 100vw, 1010px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Per le distribuzioni derivate da UBUNTU Per personalizzare il Welcome Message che appare dopo l&#8217;avvenuta autenticazione SSH, procedi come segue:Apri un terminale e digita i seguenti comandi: $ sudo apt [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3375,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[5,86,93],"tags":[],"class_list":["post-3343","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gcportal-links","category-guide-tutorial","category-linux"],"_links":{"self":[{"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/posts\/3343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3343"}],"version-history":[{"count":14,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/posts\/3343\/revisions"}],"predecessor-version":[{"id":7113,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/posts\/3343\/revisions\/7113"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/media\/3375"}],"wp:attachment":[{"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gcportal.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}