home_server:home_server_setup:other_services:ssh

This is an old revision of the document!


Prev  
 Next

SSH Notes

  • MOTD = Message of the Day
  • sudo vim /etc/issue.net Displays a message before the user begins login, I do not use this.
    • sudo vim /etc/ssh/sshd_config ensure the following option is set Banner /etc/issue.net (you can actually used any path/file)
    • sudo systemctl reload sshd needs to be performed after any change to the configuration file to activate the changes.
  • sudo vim /etc/motd Displays the banner text after login. This usually has some predefined Linux distribution text
  • 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:

  • /app/www/public/data/attic/home_server/home_server_setup/other_services/ssh.1656219973.txt.gz
  • Last modified: 2023-04-30 Sun wk17 17:44
  • (external edit)