#!/bin/bash<br>
echo -n &quot;Welcome to the Computer $USER&quot;<br><br>Unless there is absolutely going to only ever be one user you want to so treat, I would write a script for it.<br><br><div class="gmail_quote">On Wed, Sep 14, 2011 at 3:37 PM, James Sumners <span dir="ltr">&lt;<a href="mailto:james.sumners@gmail.com">james.sumners@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Well, I had thought of that, but then I read [1] and it says:<br>
<br>
&quot;SSHRC<br>
<br>
     If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment<br>
     files but before starting the user&#39;s shell or command.  It must not pro-<br>
     duce any output on stdout; stderr must be used instead.&quot;<br>
<br>
This is explicitly counter to what I want to do so I didn&#39;t even<br>
bother trying it. But, since you guys have suggested it, I just tried<br>
adding the following to ~/.ssh/rc and logging in:<br>
<br>
#!/bin/bash<br>
echo -n &quot;Does this work?\n&quot;<br>
<br>
Guess what? It worked. So, thank you for making me re-examine this option.<br>
<br>
[1] -- <a href="http://www.manpagez.com/man/8/sshd/" target="_blank">http://www.manpagez.com/man/8/sshd/</a><br>
<div><div></div><div class="h5"><br>
On Wed, Sep 14, 2011 at 15:02, Chris Fowler &lt;<a href="mailto:cfowler@outpostsentinel.com">cfowler@outpostsentinel.com</a>&gt; wrote:<br>
&gt; On Wed, 2011-09-14 at 14:31 -0400, Michael H. Warfield wrote:<br>
&gt;<br>
&gt;&gt; Anything wrong with sticking it in their (or the default) sshrc file?<br>
&gt;&gt;<br>
&gt;<br>
&gt; I think that is an excellent solution.<br>
&gt;<br>
&gt; --------------------------------------------------------------------------------<br>
&gt; 5.6.4. Arbitrary Actions with /etc/sshrc<br>
&gt; When a user logs in, the normal Unix login system typically runs some<br>
&gt; shell scripts, such as /etc/profile. In addition, sshd runs the<br>
&gt; script /etc/sshrc for each SSH-based login. This feature lets the system<br>
&gt; administrator run special commands for SSH logins that don&#39;t occur for<br>
&gt; ordinary logins. For example, you can do some additional logging of SSH<br>
&gt; connections, print welcome messages for SSH users only, and set<br>
&gt; SSH-related environment variables.<br>
&gt;<br>
&gt; In all three, SSH1, SSH2, and OpenSSH, /etc/sshrc is processed by<br>
&gt; theBourne shell ( /bin/sh) specifically, rather than the user&#39;s shell,<br>
&gt; so that it can run reliably for all accounts regardless of their various<br>
&gt; shells. It is run for logins (e.g., ssh my-host) and remote commands<br>
&gt; (ssh my-host /bin/who), just before the user&#39;s shell or command is<br>
&gt; invoked. It runs under the target account&#39;s uid, so it can&#39;t take<br>
&gt; privileged actions. If the script exits due to an error (say, a syntax<br>
&gt; error), the SSH session continues normally.<br>
&gt;<br>
&gt; Note that this file is run as input to the Bourne shell: sshd<br>
&gt; runs /bin/sh /etc/sshrc, not /bin/sh -c /etc/sshrc. This means that it<br>
&gt; can&#39;t be an arbitrary program; it must be a file containing Bourne-shell<br>
&gt; commands (and it doesn&#39;t need the execute mode bit set).<br>
&gt;<br>
&gt; /etc/sshrc operates machinewide: it is run for every incoming SSH<br>
&gt; connection. For more fine-grained control, each user may create the<br>
&gt; script ~/.ssh/rc to be run instead of /etc/sshrc. [Section 8.4, &quot;The<br>
&gt; User rc File &quot;] /etc/sshrc isn&#39;t executed if ~/.ssh/rc exists in the<br>
&gt; target account. Note that SSH rc files interact with X authentication.<br>
&gt; [Section 9.3.5.2, &quot;xauth and the SSH rc files&quot;]<br>
&gt;<br>
&gt; --------------------------------------------------------------------------------<br>
&gt;<br>
&gt; Create an /etc/sshrc and then create individual files<br>
&gt; in /etc/user_motds/  Then use the UID&#39;s to display the individual files.<br>
&gt; Something as simple as this:<br>
&gt;<br>
&gt; #!/bin/sh<br>
&gt;<br>
&gt; MOTD=&quot;/etc/user_motds/${UID}.txt<br>
&gt;<br>
&gt; if [ -f $MOTD ]<br>
&gt; then<br>
&gt;  cat $MOTD<br>
&gt; fi<br>
<br>
<br>
<br>
</div></div><div class="im">--<br>
James Sumners<br>
<a href="http://james.roomfullofmirrors.com/" target="_blank">http://james.roomfullofmirrors.com/</a><br>
<br>
&quot;All governments suffer a recurring problem: Power attracts<br>
pathological personalities. It is not that power corrupts but that it<br>
is magnetic to the corruptible. Such people have a tendency to become<br>
drunk on violence, a condition to which they are quickly addicted.&quot;<br>
<br>
Missionaria Protectiva, Text QIV (decto)<br>
CH:D 59<br>
<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>This Apt Has Super Cow Powers - <a href="http://sourcefreedom.com">http://sourcefreedom.com</a><br>