In comp.os.linux.misc, David W. Hodgins <
dwho...@nomail.afraid.org> wrote:
> On Mon, 05 Aug 2019 14:36:34 -0400, Eli the Bearded <*@
eli.users.panix.com> wrote:
> > Answer: use the Banner setting in /etc/ssh/sshd_config. It takes a
> > filename, and the contents of that will be shown before login.
> Interesting idea, in that I could put escape codes in the file shown
> that would change the foreground and/or background colours with different
> ones on different systems, however it would have the problem of leaving
> those colours set on exiting from the ssh session, as there is no option
> to display a file on exiting.
Escape codes for a terminal when you don't know what the terminal is is
bad form. How hard, really, is a just a plain text message about who can
use the machine?
If you want to change colors on login / exit, consider using .login /
.logout controls; those files will be able to access terminal type. But
.logout won't run on a connection that just dies, and .profile outputing
text for non-interactive logins will break, eg, scp. The sshd Banner
method will be printed for scp (and will not break scp).
In sh like shells, you can use code like this for only setting things
during interactive sessions:
case "$-" in *i*) # only run on interactive shells
case "$TERM" in
*xterm*) : xterm settings ;;
linux) : console settings ;;
tvi925) : TeleVideo 925 settings ;;
*) : fallback terminal settings -- probably best none ;;
esac # case "$TERM"
;; esac
> I normally leave a konsole session open at all times. As this is the first
> time I've made this mistake in at least a decade, I've decided to just get
> into the habit of closing all konsole sessions, when not currently in use.
Not sure how konsole relates to my suggesion.
Elijah
------
"console" is being (faking) right in front of the computer as opposed to remote