Motd

Updated: September 28, 2024

Setup welcome message.


BY DEFUALT 2 MOTD’s ARE ACTIVE.

TURNOFF SSHDs

Hash out the follwing 2 lines

sudo vim /etc/pam.d/sshd
session   optional    pam_motd.so motd=/run/motd.dynamic
session   optional    pam_motd.so noupdate

Creating a custom banner for logins

  1. Remove Default MOTD
sudo vim /etc/motd
add ascii art
  1. Modify or Remove UNAME /etc/update-motd.d/10-uname
uname -snrvm    # comment it out
  1. Remove Mail
sudo vim /etc/pam.d/sshd
comment out session optional pam_mail.so standard noenv # [1]
  1. Remove Last Login (optional)
sudo vim /etc/ssh/sshd_config
change PrintLastLogin no

Customizing MOTD

  1. Install fortune cowsay
  2. Add either line you want to .bashrc of .zshrc
# not working
echo -e "\e[00;35m$(fortune | cowsay -f skeleton)\e[00m"
echo -e "\e[00;35m$(cowsay -pn -f skeleton)\e[00m"