[ale] Scriptable motd for initial SSH login?

Michael H. Warfield mhw at WittsEnd.com
Wed Sep 14 14:31:30 EDT 2011


On Wed, 2011-09-14 at 14:02 -0400, James Sumners wrote: 
> I asked the question at [1], but have not had any decent answers. I
> want to setup a "motd" for a specific user such that when that user
> logs in via SSH, the motd is executed and displayed. The script should
> _only_ run when the user logs in via SSH and not via a subsequent
> login. That is, if the user starts `screen` after logging in, the motd
> should not be shown for that screen instance, nor any subsequent
> screens.

> Any suggestions?

> [1] -- http://serverfault.com/questions/310596/custom-motd-for-a-specific-user-after-logging-in-via-ssh

Anything wrong with sticking it in their (or the default) sshrc file?

~/.ssh/rc

or

/etc/ssh/sshrc

Either should work and you could customize the system wide one to do
something different for each user.  Has the advantage that it's not in
the users directory and it's not something they can tamper with.

> -- 
> James Sumners
> http://james.roomfullofmirrors.com/
> 
> "All governments suffer a recurring problem: Power attracts
> pathological personalities. It is not that power corrupts but that it
> is magnetic to the corruptible. Such people have a tendency to become
> drunk on violence, a condition to which they are quickly addicted."
> 
> Missionaria Protectiva, Text QIV (decto)
> CH:D 59

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20110914/b3e421e5/attachment.bin 


More information about the Ale mailing list