awesome, thanks for the info. 2009/12/8 Amos Shapira <[email protected]>
> 2009/12/8 Tom Goren <[email protected]> > > does it work with *su* (as opposed to over ssh)? >> >> i.e. *su - bybass -c "/Path/To/bypass.sh** param1 param2" >> >> *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... >> >> 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 * >> .bashrc* >> >> please someone correct me if i am mistaken. >> > > I beg to differ. > > 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. > e.g. "/bin/nologin" or "/bin/halt". > > The script should probably be pretty secure to prevent leaks (e.g. allow > injection of code via unquoted input). > > 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: > > #!/bin/bash > echo Arguments: "$*" > > And when I ssh to it I get: > > # ssh testu...@localhost arg1 > testu...@localhost's password: > Arguments: -c arg1 > > Seems to work fine. The OP will have to give more info to get help. > > --Amos > > >> tom. >> >> >> >> 2009/12/6 Shay Ohayon <[email protected]> >> >> Try running the command its parameters inside quotes (") >>> >>> for example: ssh u...@host "command param1 paramN" >>> >>> 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. >>> >>> good luck >>> >>> shay >>> >>> >>> On Sun, Dec 6, 2009 at 5:31 PM, eliyahu cohen >>> <[email protected]>wrote: >>> >>>> I have a user called bypass whose defined shell in /etc/passwd is >>>> /Path/To/bypass.sh >>>> >>>> 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 [email protected] Parm1 Parm2 Parm2) >>>> the script does not see all three parameters. I've also tried calling the >>>> script via ssh [email protected] /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? >>>> >>>> Thanks, >>>> >>>> Eliyahu >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> Linux-il mailing list >>>> [email protected] >>>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >>>> >>> >>> >>> _______________________________________________ >>> Linux-il mailing list >>> [email protected] >>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >>> >>> >> >> _______________________________________________ >> Linux-il mailing list >> [email protected] >> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il >> >> >
_______________________________________________ Linux-il mailing list [email protected] http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
