{"id":1194,"date":"2022-09-29T22:51:33","date_gmt":"2022-09-29T20:51:33","guid":{"rendered":"https:\/\/techtocraft.xyz\/?p=1194"},"modified":"2025-04-24T19:00:39","modified_gmt":"2025-04-24T17:00:39","slug":"creer-un-motd-pour-vos-serveurs-linux","status":"publish","type":"post","link":"https:\/\/hinakuu.xyz\/?p=1194","title":{"rendered":"Cr\u00e9er un MOTD pour vos serveurs Linux"},"content":{"rendered":"\n<p>Si comme moi vous avez plusieurs serveurs Linux \u00e0 vous occuper, cr\u00e9er un&nbsp;<em>MOTD (Message Of The Day)<\/em>&nbsp;est l\u00e0 modification indispensable \u00e0 r\u00e9aliser lors de l\u2019installation de votre serveur. Souvent ignor\u00e9, il peut vous \u00e9viter des erreurs et m\u00eame vous donner des informations importantes sur votre serveur d\u00e8s votre connexion.&nbsp;<em>INDISPENSABLE !!!<\/em><\/p>\n\n\n\n<p>Source :<a href=\"https:\/\/quick-tutoriel.com\/creer-un-motd-pour-vos-serveurs-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\"> <\/a><a href=\"https:\/\/cloriou.fr\/2020\/04\/02\/ajouter-motd-dynamique-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/cloriou.fr\/2020\/04\/02\/ajouter-motd-dynamique-debian\/<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>C\u2019est quoi un MOTD ?<\/strong><\/h3>\n\n\n\n<p><em>MOTD (Message Of The Day)<\/em>&nbsp;est un message envoy\u00e9 \u00e0 un logiciel client lors de son identification sur des serveurs (tels que les serveurs IRC, SSH ou encore FTP). G\u00e9n\u00e9ralement, ce message est utilis\u00e9 pour afficher les r\u00e8gles, les contacts administratifs, ou encore un dessin ASCII Art.<br>Ce message peut \u00eatre personnalis\u00e9 pour afficher le nom de la machine, son IP, diverses statistiques comme la consommation CPU, M\u00e9moire, \u2026<\/p>\n\n\n\n<p>Voici un exemple de MOTD :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"247\" src=\"https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Motd2.png\" alt=\"\" class=\"wp-image-3507\" srcset=\"https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Motd2.png 455w, https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Motd2-300x163.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Comment modifier le MOTD ?<\/mark><\/strong><\/h3>\n\n\n\n<p>Tout d\u2019abord ce tutoriel se d\u00e9roulera sur Ubuntu. Pour faire simple, nous allons cr\u00e9er des scripts que nous allons plac\u00e9s dans un r\u00e9pertoire sp\u00e9cifique. Ces scripts seront ex\u00e9cut\u00e9s \u00e0 chaque connexion de l\u2019utilisateur.<\/p>\n\n\n\n<p>Sur mes switchs j\u2019ai pris l\u2019habitude de cr\u00e9er une banni\u00e8re en Ascii avec le nom de la soci\u00e9t\u00e9. Nous allons donc reproduire ceci sur nos serveurs Linux. Pour cr\u00e9er ce style d\u2019\u00e9criture particulier nous allons d\u2019abord ajouter le&nbsp;<em>paquet figlet<\/em>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo apt-get update &amp;&amp; apt-get install figlet<\/mark><\/pre>\n\n\n\n<p>Puis apr\u00e8s l\u2019installation pour s\u2019assurer que tout fonctionne correctement utiliser la commande suivante :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo figlet Quick-Tutoriel<\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>  ___        _      _       _____      _             _      _\n \/ _ \\ _   _(_) ___| | __  |_   _|   _| |_ ___  _ __(_) ___| |\n| | | | | | | |\/ __| |\/ \/____| || | | | __\/ _ \\| '__| |\/ _ \\ |\n| |_| | |_| | | (__|   &lt;_____| || |_| | || (_) | |  | |  __\/ |\n \\__\\_\\\\__,_|_|\\___|_|\\_\\    |_| \\__,_|\\__\\___\/|_|  |_|\\___|_|\n<\/code><\/pre>\n\n\n\n<p>Ensuite vous devez aller dans le r\u00e9pertoire&nbsp;<em>\/etc\/update-motd.d\/<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">cd etc\/update-motd.d<\/mark><\/pre>\n\n\n\n<p>Info !!!&nbsp;Si celui-ci n\u2019existe pas, il faut alors le cr\u00e9er et lui donner les droits en ex\u00e9cution suivant avec cette commande :&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">mkdir \/update-motd.d &amp;&amp; chmod 644 \/update-motd.d<\/mark><\/pre>\n\n\n\n<p>Si ce dossier existe, vous devez voir plusieurs fichiers (= scripts) avec des num\u00e9ros. Le principe est simple, tous les scripts se trouvant dans ce dossier sont ex\u00e9cut\u00e9s lors de la connexion. Il suffit de les nomm\u00e9s <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">00-xxx<\/mark>, <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\">10-xxx<\/mark>,<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-amber-color\"> 20-xxx<\/mark>, etc. pour qu\u2019ils soient ex\u00e9cut\u00e9s dans l\u2019ordre de votre choix.<\/p>\n\n\n\n<p>Comme je veux repartir \u00e0 z\u00e9ro, je d\u00e9cide donc de d\u00e9placer ces fichiers dans mon r\u00e9pertoire Temp.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># move * \/temp\/<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Les premiers pas pour cr\u00e9er un MOTD.<\/mark><\/strong><\/h3>\n\n\n\n<p>Je vous donnerais mes sources \u00e0 la fin de l\u2019article. J\u2019ai pas mal \u00e9cum\u00e9 le web pour trouver un mod\u00e8le qui me plaisais et qui \u00e9tait pratique.<\/p>\n\n\n\n<p>Afin d\u2019am\u00e9liorer un peu le rendu du MOTD, nous allons ajouter de la couleur. La premi\u00e8re \u00e9tape sera d\u2019afficher le nom du serveur avec la police type ASCII le tout en couleur. Tout un programme.<\/p>\n\n\n\n<p>Je vais donc&nbsp;<em>cr\u00e9er un fichier colors<\/em>&nbsp;et je vais coller les codes couleurs ci-dessous dans le fichier. J\u2019ai aussi rajout\u00e9 les possibilit\u00e9s de mettre un texte en gras ou soulign\u00e9.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">nano colors<br><\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># Reset Colors\nNONE=\"\\033&#91;m\"\n\n# Colors\nWHITE=\"\\033&#91;1;37m\"\nGREEN=\"\\033&#91;1;32m\"\nRED=\"\\033&#91;0;32;31m\"\nYELLOW=\"\\033&#91;1;33m\"\nBLUE=\"\\033&#91;34m\"\nCYAN=\"\\033&#91;36m\"\nLIGHT_GREEN=\"\\033&#91;1;32m\"\nLIGHT_RED=\"\\033&#91;1;31m\"\n\n# Bold\nBOLD=\"\\033&#91;1m\"\n\n# Underline\nUNDERLINE=\"\\033&#91;4m\"<\/code><\/pre>\n\n\n\n<p>On va maintenant passer au script pour&nbsp;<strong>afficher le nom du serveur<\/strong>. Toujours dans le dossier&nbsp;<code>\/update-motd.d<\/code>&nbsp;nous allons cr\u00e9er un fichier&nbsp;<code>00-hostname<\/code>&nbsp;via&nbsp;<code>nano 00-hostname<\/code>&nbsp;et dont le code est le suivant :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">nano 00-hostname<\/mark><br><br>testez :<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo \/etc\/update-motd.d\/00-hostname<\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/sh<br><br># Appel du fichier avec les codes couleurs<br>. \/etc\/update-motd.d\/colors<br><br># Affichage du nom du serveur avec l'extension Prod ou Valid<br># En rouge pour les serveurs de Prod et en vert pour les autres.<br>printf \"\\n\"$LIGHT_RED<br>figlet \" \"$(hostname -s) - Prod<br>printf $NONE<br>printf \"\\n\"<br><br><\/code><\/pre>\n\n\n\n<p>Ensuite je vais cr\u00e9er le fichier&nbsp;<em>10-banner<\/em>&nbsp;pour afficher la version du syst\u00e8me utilis\u00e9e ainsi que son nom de code et la version du noyau.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">nano 10-banner<\/mark><br><br>testez :<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo \/etc\/update-motd.d\/10-banner<br><\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n#\n#    Copyright (C) 2009-2010 Canonical Ltd.\n#\n#    Authors: Dustin Kirkland &lt;kirkland@canonical.com&gt;\n#\n#    This program is free software; you can redistribute it and\/or modify\n#    it under the terms of the GNU General Public License as published by\n#    the Free Software Foundation; either version 2 of the License, or\n#    (at your option) any later version.\n#\n#    This program is distributed in the hope that it will be useful,\n#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#    GNU General Public License for more details.\n#\n#    You should have received a copy of the GNU General Public License along\n#    with this program; if not, write to the Free Software Foundation, Inc.,\n#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n\n. \/etc\/update-motd.d\/colors\n\n&#91; -r \/etc\/update-motd.d\/lsb-release ] &amp;&amp; . \/etc\/update-motd.d\/lsb-release\n\nif &#91; -z \"$DISTRIB_DESCRIPTION\" ] &amp;&amp; &#91; -x \/usr\/bin\/lsb_release ]; then\n    # Fall back to using the very slow lsb_release utility\n    DISTRIB_DESCRIPTION=$(lsb_release -s -d)\nfi\n\nre='(.*\\()(.*)(\\).*)'\nif &#91;&#91; $DISTRIB_DESCRIPTION =~ $re ]]; then\n    DISTRIB_DESCRIPTION=$(printf \"%s%s%s%s%s\" \"${BASH_REMATCH&#91;1]}\" \"${YELLOW}\" \"${BASH_REMATCH&#91;2]}\" \"${NONE}\" \"${BASH_REMATCH&#91;3]}\")\nfi\n\necho -e \"  \"$DISTRIB_DESCRIPTION \"(kernel \"$(uname -r)\")\\n\"\n\n# Update the information for next time\nprintf \"DISTRIB_DESCRIPTION=\\\"%s\\\"\" \"$(lsb_release -s -d)\" &gt; \/etc\/update-motd.d\/lsb-release &amp;<\/code><\/pre>\n\n\n\n<p>Une petite pr\u00e9cision sur l\u2019ex\u00e9cution de&nbsp;<em>lsb_release<\/em>. Cet utilitaire rempli des variables syst\u00e8me pour pouvoir r\u00e9cup\u00e9rer les informations de version de son serveur Linux. Voici les variables avec un exemple de contenu :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">DISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.6 LTS\"<\/pre>\n\n\n\n<p>Maintenant, je souhaite dans mon cas, ajouter diff\u00e9rentes informations comme&nbsp;<strong>le CPU, la charge du syst\u00e8me, la RAM libre<\/strong>, etc. J\u2019ai donc pour cela, cr\u00e9\u00e9 un script que j\u2019ai nomm\u00e9&nbsp;<code>20-sysinfo<\/code>&nbsp;dont le code est le suivant :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">nano 20-sysinfo<\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Appel du fichier avec les variables de couleurs\n. \/etc\/update-motd.d\/colors\n\n# R\u00e9cup\u00e9ration des informations \u00e0 afficher\n# R\u00e9cup\u00e9ration des infos sur le processeur\nproc=`cat \/proc\/cpuinfo | grep model | cut -c14- | sed -n \"2 p\"`\n# Supprime les espaces dans Avant\/ Apr\u00e8s\nproc=$(echo \"${proc}\" | sed 's\/^ *\/\/g')\n# R\u00e9cup\u00e8re le nombre de coeurs\ncoeurs=`cat \/proc\/cpuinfo | grep -i \"^processor\" | wc -l`\n# r\u00e9cup\u00e8re la m\u00e9moire RAM SWAP Libre et Total\nmemfree=`cat \/proc\/meminfo | grep MemFree | awk {'print $2'}`\nmemtotal=`cat \/proc\/meminfo | grep MemTotal | awk {'print $2'}`\nswaptotal=`cat \/proc\/meminfo | grep SwapTotal | awk {'print $2 \" \" $3'}`\npourcentfree=$((($memfree * 100)\/$memtotal))\n# R\u00e9cup\u00e8re l'uptime du serveur\nuptime=`uptime -p`\n# R\u00e9cup\u00e8re l'adresse IP du serveur\naddrip=`hostname -I | cut -d \" \" -f1`\n# R\u00e9cup\u00e8re le nombre de processus en ex\u00e9cution\nprocess=`ps ax | wc -l | tr -d \" \"`\n# R\u00e9cup\u00e8re le nombre d'utilisateur connect\u00e9 en SSH\/Console\nconnecteduser=`who | wc -l`\n\n# R\u00e9cup\u00e9re le loadavg\nread one five fifteen rest &lt; \/proc\/loadavg\n\n# Affichage des variables\nprintf \"\"$LIGHT_GREEN\nprintf \" Processeur :\"\nprintf \"\"$NONE\nprintf \" $proc ($coeurs cores)\"\nprintf \"\\n\"\nprintf \"\"$LIGHT_GREEN\nprintf \" Charge CPU :\"\nprintf \"\"$NONE\nprintf \" $one (1min) \/ $five (5min) \/ $fifteen (15min)\"\nprintf \"\\n\"\nprintf \"\"$LIGHT_GREEN\nprintf \" RAM :\"\nprintf \"\"$NONE\nprintf \" $(($memfree\/1024)) MB soit $pourcentfree%% Libre \/ $(($memtotal\/1024)) MB Total\"\nprintf \"\\n\"\nprintf \"\"$LIGHT_GREEN\nprintf \" Processes :\"\nprintf \"\"$NONE\nprintf \" $process\"\nprintf \"\"$LIGHT_GREEN\nprintf \" Users logged in :\"\nprintf \"\"$NONE\nprintf \" $connecteduser \"\nprintf \"\"$LIGHT_GREEN\nprintf \"Swap:\"\nprintf \"\"$NONE\nprintf \" $swaptotal\"\nprintf \"\"$NONE\nprintf \"\\n\"\nprintf \"\"$LIGHT_GREEN\nprintf \" Adresse IP\"\nprintf \"\"$NONE\nprintf \" $addrip\"\nprintf \"\\n\"\nprintf \"\"$LIGHT_GREEN\nprintf \" Uptime :\"\nprintf \"\"$NONE\nprintf \" $uptime\"\nprintf \"\\n\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">testez :<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo \/etc\/update-motd.d\/20-sysinfo<\/mark><\/pre>\n\n\n\n<pre id=\"block-141b2917-6595-411c-8128-3e6db34bbaf3\" class=\"wp-block-preformatted\">Astuce !!! Lorsque je me connecte en SSH j\u2019ai toujours une ligne qui vient s\u2019incruster \u00e0 la fin de mon MOTD. C<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Astuce !!! Lorsque je me connecte en SSH j\u2019ai toujours une ligne qui vient s\u2019incruster \u00e0 la fin de mon MOTD. C\u2019est la ligne qui commence par last login :\u2026.. Pour ne plus avoir afficher cette ligne il suffit d\u2019\u00e9diter le fichier de config de SSH (\/etc\/ssh\/sshd_config) puis de mettre cette option \u00e0 No, PrintLastLog no, puis de red\u00e9marrer le service SSH.<\/mark><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">Ajouter des informations utiles \u00e0 votre MOTD.<\/mark><\/strong><\/h3>\n\n\n\n<p>Vous pouvez rajouter autant d\u2019information que vous le souhaitez. Nous allons voir les classiques&#8230;<\/p>\n\n\n\n<p>Autre point important, vous devez rendre ex\u00e9cutable les fichiers que vous cr\u00e9ez, sinon cela ne fonctionnera pas. Vous devrez utiliser la commande ci-dessous :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo chmod 755 00-hostname<\/mark><\/pre>\n\n\n\n<p>La m\u00eame chose sera appliqu\u00e9e aux autres fichiers en changeant bien s\u00fbr leur nom.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo chmod 755 10-banner<\/mark><br><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo chmod 755 20-sysinfo<\/mark><\/pre>\n\n\n\n<p>Si vous voulez encore ajouter des informations dans votre MOTD. Voici quelques options avanc\u00e9es que vous pouvez ins\u00e9rer.<\/p>\n\n\n\n<p>Gr\u00e2ce \u00e0 la commande apt-get vous pouvez savoir si des mises \u00e0 jour sont disponibles et si des paquets ne sont plus utiles \u00e0 votre installation. J\u2019ai nomm\u00e9 le fichier&nbsp;<em>30-upgrade<\/em>. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">nano 30-upgrade<\/mark><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n. \/etc\/update-motd.d\/colors\n\nn=$(apt-get -qq --just-print dist-upgrade | cut -f 2 -d \" \" | sort -u | wc -l)\nif &#91;&#91; $n -gt 0 ]]; then\nprintf $LIGHT_RED\nprintf \" You have %s packages waiting for upgrades.\" \"$n\"\nprintf $NONE\"\\n\\n\"\nfi\nn=$(apt-get -qq --just-print autoremove | cut -f 2 -d \" \" | sort -u | wc -l)\nif &#91;&#91; $n -gt 0 ]]; then\nprintf $YELLOW\nprintf \" You have %s packages that were automatically installed and are not needed anymore.\" \"$n\"\nprintf $NONE\"\\n\\n\"\nfi<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo chmod 755 30-upgrade<\/mark><\/pre>\n\n\n\n<p>Si vous souhaitez utiliser mon MOTD dans le fichier&nbsp;<em>30-sysinfo<\/em>, vous devrez ajuster le nom de la partition ou du disque que vous souhaitez afficher&nbsp;ainsi que la carte r\u00e9seau qui porte votre IP<\/p>\n\n\n\n<p>Attention !!!&nbsp;Les lignes ne s\u2019affichent que si le nombre de paquets est &gt; \u00e0 0.<\/p>\n\n\n\n<p>Il nous reste \u00e0 supprimer l\u2019ancien MOTD, via la commande :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">rm \/etc\/motd<\/mark><\/pre>\n\n\n\n<p>Il faut maintenant le r\u00e9cr\u00e9er via la commande :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">ln -s \/var\/run\/motd \/etc\/motd<\/mark><\/pre>\n\n\n\n<p>Rendez le script ex\u00e9cutable \u00e0 l\u2019aide de\u00a0la commande chmod\u00a0:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo chmod +x \/etc\/update-motd.d\/00-hostname<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"><br>sudo chmod +x \/etc\/update-motd.d\/10-banner<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"><br>sudo chmod +x \/etc\/update-motd.d\/20-sysinfo<\/mark><br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\"><br>sudo chmod +x \/etc\/update-motd.d\/30-upgrade<\/mark><\/pre>\n\n\n\n<p><strong>Testez l\u2019ex\u00e9cution du MOTD<\/strong>\u00a0et validez qu\u2019aucune erreur de script n\u2019appara\u00eet :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-light-green-cyan-color\">sudo run-parts \/etc\/update-motd.d\/<\/mark><\/pre>\n\n\n\n<p>Voici le MOTD :<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"274\" src=\"https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Debian-MOTD-2.png\" alt=\"\" class=\"wp-image-3519\" srcset=\"https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Debian-MOTD-2.png 604w, https:\/\/hinakuu.xyz\/wp-content\/uploads\/2022\/09\/Debian-MOTD-2-300x136.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/figure>\n\n\n\n<p>D\u2019un coup d\u2019\u0153il j\u2019ai quelques informations essentielles sur mon serveur. J\u2019attache une importance particuli\u00e8re \u00e0 la couleur de la banni\u00e8re si c\u2019est rouge c\u2019est de la production donc&nbsp;<strong>ATTENTION !!!<\/strong>, si c\u2019est vert c\u2019est de la validation donc moins risqu\u00e9e. Ces petites astuces mn\u00e9motechniques sont bien pratiques.<\/p>\n\n\n\n<p>La connexion \u00e0 votre serveur peut-\u00eatre plus ou moins longue si vous rajouter beaucoup d\u2019informations dans votre MOTD. Il faudra donc faire des choix.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Si comme moi vous avez plusieurs serveurs Linux \u00e0 vous occuper, cr\u00e9er un&nbsp;MOTD (Message Of The Day)&nbsp;est l\u00e0<\/p>\n","protected":false},"author":1,"featured_media":1044,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1194"}],"version-history":[{"count":44,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1194\/revisions"}],"predecessor-version":[{"id":3534,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/posts\/1194\/revisions\/3534"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=\/wp\/v2\/media\/1044"}],"wp:attachment":[{"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hinakuu.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}