[ale] Scriptable motd for initial SSH login?
Michael H. Warfield
mhw at WittsEnd.com
Wed Sep 14 16:37:03 EDT 2011
On Wed, 2011-09-14 at 16:22 -0400, David Tomaschik wrote:
> On Wed, Sep 14, 2011 at 3:37 PM, James Sumners <james.sumners at gmail.com> wrote:
> > Well, I had thought of that, but then I read [1] and it says:
> >
> > "SSHRC
> >
> > If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment
> > files but before starting the user's shell or command. It must not pro-
> > duce any output on stdout; stderr must be used instead."
> >
> > This is explicitly counter to what I want to do so I didn't even
> > bother trying it. But, since you guys have suggested it, I just tried
> > adding the following to ~/.ssh/rc and logging in:
> >
> > #!/bin/bash
> > echo -n "Does this work?\n"
> Make sure you're outputting to stderr, not stdout. The man page
> wasn't kidding about that. If you output to stdout, then programs
> that use SSH as a transport will be broken because they'll see the
> output of your script in their data stream. (This includes rsync,
> scp, etc.)
Right.
But that's the case even if you had another motd.
> > Guess what? It worked. So, thank you for making me re-examine this option.
> >
> > [1] -- http://www.manpagez.com/man/8/sshd/
> >
>
>
>
> --
> David Tomaschik, RHCE, LPIC-1
> System Administrator/Open Source Advocate
> OpenPGP: 0x5DEA789B
> http://systemoverlord.com
> david at systemoverlord.com
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/435cb08c/attachment.bin
More information about the Ale
mailing list