This is an old revision of the document!
SSH Notes
SSH Login Message
Acronyms and Definitions
- MOTD = Message of the Day
Login Messages
sudo vim /etc/issue.netDisplays a message before the user begins login, I do not use this.sudo vim /etc/ssh/sshd_configensure the following option is setBanner /etc/issue.net(you can actually used any path/file)sudo systemctl reload sshdneeds to be performed after any change to the configuration file to activate the changes.
sudo vim /etc/motdDisplays the banner text after login. This usually has some predefined Linux distribution text
Login Scripts
ls -la /etc/update-motd.d/to see the scripts that are run after the MOTD is displayed.
The Debian script is very simple:
#!/bin/sh uname -snrvm
Ubuntu has multiple scripts some that I like and some that I do not like. This system status information script is:
#!/bin/sh
# pam_motd does not carry the environment
[ -f /etc/default/locale ] && . /etc/default/locale
export LANG
cores=$(grep -c ^processor /proc/cpuinfo 2>/dev/null)
[ "$cores" -eq "0" ] && cores=1
threshold="${cores:-1}.0"
if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` < $threshold" | bc) -eq 1 ]; then
echo
echo -n " System information as of "
/bin/date
echo
/usr/bin/landscape-sysinfo
else
echo
echo " System information disabled due to load higher than $threshold"
fi
The main information script is written in python3.
Some Links: