[TriLUG] Semi-OT: MOTD only in TELNET?
Tanner Lovelace
clubjuggler at gmail.com
Wed Jun 6 16:27:06 EDT 2007
On 6/6/07, Brian Henning <Brian.Henning at datadirect.com> wrote:
> What I'd like to do is have a MOTD that calmly suggests users switch to
> SSH. To the effect of "You're using telnet. Though telnet is enabled
> on this server, we encourage you to consider switching to SSH, because
> it is better." So what I want to happen is that message be displayed at
> logon, but only if the user is connecting via telnet. I don't want it
> to be displayed if the user is connecting via ssh.
>
> /etc/motd is used by logon, and would be displayed any time logon
> creates a shell for a user, whether telnet or ssh or local, so that's
> right out. Does anyone know of a way to get a MOTD to display only for
> a particular kind of connection? Maybe a way to set up a login script
> that only runs when it's a telnet connection?
Brian,
You're looking for /etc/issue.net
http://www.die.net/doc/linux/man/man5/issue.net.5.html
"issue.net - identification file for telnet sessions"
I think that should do what you want.
Cheers,
Tanner
--
Tanner Lovelace
clubjuggler at gmail dot com
http://wtl.wayfarer.org/
(fieldless) In fess two roundels in pale, a billet fesswise and an
increscent, all sable.
More information about the TriLUG
mailing list