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.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 setBanner /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
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,
''/etc/update-motd.d/50-landscape-sysinfo'':
The main information script is written in python3, /usr/bin/landscape-systeminfo
:
#!/usr/bin/python3 import sys, os try: if os.path.dirname(os.path.abspath(sys.argv[0])) == os.path.abspath("scripts"): sys.path.insert(0, "./") else: from landscape.lib.warning import hide_warnings hide_warnings() from twisted.internet import reactor from landscape.sysinfo.deployment import run except ImportError: # For some reasons the libraries are not importable for now. We are # probably during an upgrade procedure, so let's exit, expecting the # dependencies to be fixed at next run. sys.exit(2) if __name__ == "__main__": run(sys.argv[1:], reactor)
Some Links: