Show my custom ssh/terminal login message (motd): -------------------------------------------------- This starts/shows neofetch when login into Ubuntu on ssh: On the Ubuntu server, go to directory /etc/update-motd.d This folder is for exactable scripts to ad to motd (the terminal login message program on Linux/Unix). Can also view dictanary with: ls /etc/update-motd.d --------------------------------- Make parts you no longer want in motd un-exactable with: sudo chmod -x /etc/update-motd.d/* This will remove all paragrapths from motd, Will re enable what I want later in instructions. ----------------------------------- To add neotech, create the 01-neo file in the /etc/update-motd.d with nano (no .txt exstention and need sudo, can be any name with a ##- at the start but this is my preferred name) create file: sudo nano /etc/update-motd.d/01-neo and add this code: #!/bin/bash neofetch echo save 01-neo with ^X then Y --------------------------------------- To add cpufetch, create the 02-cpufetch file in the /etc/update-motd.d with nano (no .txt exstention and need sudo, can be any name with a ##- at the start but this is my preferred name) create file: sudo nano /etc/update-motd.d/02-cpufetch and add this code: #!/bin/bash cpufetch echo save 01-neo with ^X then Y ------------------------------------------------------------ To then add ntp clock status create the 03-clock file with sudo nano and add this code: sudo nano /etc/update-motd.d/03-clock #!/bin/bash timedatectl status echo systemctl status systemd-timesyncd | grep Status echo systemctl status systemd-timesyncd | grep Active echo Then save it, this will show basic clock status, plus show what ntp server I am connecting to, and show how long the ntp server has been running for (usually the same amount of time as the server it's self, with few exceptions). ------------------------------------------ Then to show cpu temperature, create the 03-temp file and add this code: (You will have needed to create the temp script shown elsewhere on this website). sudo nano /etc/update-motd.d/03-temp #!/bin/bash echo "============================" echo "CPU Temputure is: " temp echo echo "============================" Then save it, and this will display the cpu temputure. -------------------------------------------------------- Also, create a note to show what ver of java is installed (if any, only enable if I did install java). sudo nano /etc/update-motd.d/93-java-ver Contents fo file: #!/bin/bash java --version echo Then save it with ^X ------------------------------------------------------------------------- Also, create a note script to show cmmon used comands relating to my server: sudo nano /etc/update-motd.d/96-notes Contents fo file: #!/bin/bash echo "========================================================================================================================" echo "reset permissions (in case of file locking) of all NFS drives with command: sudo chmod -R 777 /opt/RD/*" echo "Show detailed system monitor (CLI) with command: btop" echo "Show detailed system power consumption (CLI) with command: sudo powertop" echo "See boot loader info with: 'vcgencmd bootloader_version' *Raspberry PI 4B only! " echo "Location of web files: /var/www/html" echo "Use: 'wget url & disown' to download files when want logged off" echo "Modern Youtube-dl is now called yt-dlp . It is much faster and more stable." echo "ytd is my allis to 'yt-dlp -f bestvideo+bestaudio/best --merge-output-format mkv'" echo "Use: 'nohup ytd url >> log.txt &' to download youtube videos when want logged off" echo "Copy Apache log files to SNAS to view by: cp -a -r /var/log/apache2/. /opt/RD/SNAS/Logs/apache2" echo "yt-thumb is my allis to download a YouTube thumbnail (image only)." echo "Run sudo rm /var/www/html/mycloud/nextcloud.log to allow Nextcloud run an update." echo "========================================================================================================================" echo Then save it with ^X ----------------------------------------------------------- To show specific CPU information, only really used on Wii U. sudo nano /etc/update-motd.d/04-cpu #!/bin/bash lscpu echo Then save it with ^X ------------------------------------------------------------- *This is for NEC PC's only: sudo nano /etc/update-motd.d/94-nec #!/bin/bash echo "This is spec listings for this server: " echo dmidecode | grep -e Product -e Vendor -e Family -e Release echo Then save it with ^X -------------------------------------------------------------- *This is used on pi only, this will provide Bootloader date and other info sudo nano /etc/update-motd.d/88-pi_boot #!/bin/bash echo "============================" echo "Your Raspberry Pi Bootloader(Firmware) infomation: " vcgencmd bootloader_version echo echo "============================" Then save it with ^X -------------------------------------------------------------- Then I will add back the parts I usually use as well as what I just created through: cd /etc/update-motd.d/ sudo chmod +x 90* 91* 92* 98-reboot-required 96-notes 03-temp 02-cpufetch 03-clock 01-neo 93-java-ver 04-cpu 88-pi_boot Then log off then log back on and you should have custom motd screen. ------------------------------------------- Source: https://linuxconfig.org/how-to-change-welcome-message-motd-on-ubuntu-18-04-server Date: March 26th, 2021 - March 31st, 2021