Another possibility would be (at least from my standpoint) defining some function for ssh
ing which would print some banner before actually entering the ssh
session. Just get creative if you need it.
Example function:
unalias ssh 2> /dev/null
ssh ()
{
if ! { [ $# -eq 2 ] && [ -n "$1" ] && [ -n "$2" ]; } then
# shellcheck disable=SC2016
printf >&2 '%s\n' 'Expecting $1 = username, $2 = computer'
return 1
fi
case "$1" in
(user1) banner='This will be great SSH!' ;;
(user2) banner='Enjoy your SSH session!' ;;
(*) banner='Some generic banner ...' ;;
esac
printf '%s\n' \
"Entering SSH session as user $1 onto computer $2 ..." \
"$banner"
command ssh "$1"@"$2"
}
Example call:
ssh root 192.168.0.1
Example output:
Entering SSH session as user root onto computer 192.168.0.1 ...
Some generic banner ...
BusyBox v1.30.1 () built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 19.07.3, r11063-85e04e9f46
-----------------------------------------------------