<div dir="ltr">awesome, thanks for the info.<br><br><div class="gmail_quote">2009/12/8 Amos Shapira <span dir="ltr"><<a href="mailto:amos.shapira@gmail.com">amos.shapira@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr"><div class="gmail_quote">2009/12/8 Tom Goren <span dir="ltr"><<a href="mailto:motnerog@gmail.com" target="_blank">motnerog@gmail.com</a>></span><div class="im"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>does it work with <b>su</b> (as opposed to over ssh)?<br><br>i.e. <b>su - bybass -c "/Path/To/bypass.sh</b><b> param1 param2"<br><br></b>also, more information is definitely required, especially why you are trying to use this script as the default user shell, which does not sound like best practices...<br>
<br>a shell is a shell, and a script is a script. if you want to run something by default whenever the user logs in, then just use /bin/bash as the default shell, and then set up whatever you need in the user's respective <b>.bashrc</b><br>
<br>please someone correct me if i am mistaken.</div></blockquote></div><div><br>I beg to differ. <br><br>It's legitimate to assign a special script as a login shell when you want to limit the user to just executing that command when logging in.<br>
e.g. "/bin/nologin" or "/bin/halt".<br><br>The script should probably be pretty secure to prevent leaks (e.g. allow injection of code via unquoted input).<br><br>I just created a user "testuser" on my desktop, assigned it a password, made sure it has a home directory and a file named .hushlogin under it and set its shell to the following script:<br>
<br>#!/bin/bash<br>echo Arguments: "$*"<br><br>And when I ssh to it I get:<br><br># ssh testuser@localhost arg1<br>testuser@localhost's password: <br>Arguments: -c arg1<br><br>Seems to work fine. The OP will have to give more info to get help.<br>
<font color="#888888">
<br>--Amos<br><br></font></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr"><br>tom.<br><br><br><br><div class="gmail_quote">
2009/12/6 Shay Ohayon <span dir="ltr"><<a href="mailto:shay@shayohayon.net" target="_blank">shay@shayohayon.net</a>></span><div>
<div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Try running the command its parameters inside quotes (")<br><br>for example: ssh user@host "command param1 paramN" <br><br>I must say that it is quite difficult to provide you with a solution because I don't really know what the script does and how does it handles each parameter, it would be better if you can provide it to me.<br>
<br>good luck<br><font color="#888888"><br>shay</font><div><div></div><div><br><br><div class="gmail_quote">On Sun, Dec 6, 2009 at 5:31 PM, eliyahu cohen <span dir="ltr"><<a href="mailto:eliyahu.cohen1@yahoo.com" target="_blank">eliyahu.cohen1@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a user called bypass whose defined shell in /etc/passwd is /Path/To/bypass.sh<br>
<br>
that script takes three parameters. When I run the script from the command line the script identifies the parameters. However, when the script is run via an ssh command (i.e. ssh <a href="mailto:bypass@10.1.1.1" target="_blank">bypass@10.1.1.1</a> Parm1 Parm2 Parm2) the script does not see all three parameters. I've also tried calling the script via ssh <a href="mailto:bypass@10.1.1.1" target="_blank">bypass@10.1.1.1</a> /Path/To/bypass.sh Parm1 Parm2 Parm3, but no joy. How can I have a script run as the users shell and execute multiple receieved parameters?<br>
<br>
Thanks,<br>
<br>
Eliyahu<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div></div><br></div>
</blockquote></div><br></div>