vi /etc/ssh/sshd_config PrintMotd yes PrintLastLog no
Relancer le service
systemctl restart sshd.service
Installer les paquets net-tools, lolcat, figlet et toilet
apt install net-tools figlet toilet lolcat -y
effacer le fichier motd
rm /etc/motd
Editer le fichier /etc/update-motd.d/10-uname
#!/bin/sh toilet -f slant $(hostname) | /usr/games/lolcat -f -F 0.3 printf "\n" ip=`ifconfig eth0 | awk '/inet / {print $2}' | cut -d ':' -f2` #ip2=`ifconfig eth1 | awk '/inet / {print $2}' | cut -d ':' -f2` uptime=`uptime | grep -ohe 'up .*' | sed 's/,/\ hours/g' | awk '{ printf $2" "$3 }'` ID=$(grep -oP '(?<=^ID=).+' /etc/os-release | tr -d '"') VERSION=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') CODENAME=$(grep -oP '(?<=^VERSION_CODENAME=).+' /etc/os-release | tr -d '"') os=$(echo $ID $VERSION $CODENAME) date=`date "+DATE: %A %d %B %Y %H:%M:%S" | awk '{print $2, $3, $4, $5, $6}'` root_usage=`df -h / | awk '/\// {print $(NF-1)}'` processes=`ps aux | wc -l` echo printf "Date : %s\n" "$date" | /usr/games/lolcat -f -F 0.4 echo printf "OS Release :\t%s\tUptime :\t%s\n" "$os" "$uptime" | /usr/games/lolcat -f -F 0.4 printf "Nb Process :\t%s\t\t\tIP lan :\t%s\n" $processes $ip | /usr/games/lolcat -f -F 0.4 printf "Usage FS :\t%s\n" $root_usage | /usr/games/lolcat -f -F 0.4 echo echo
Sources :