Re: ssh and change group id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 11, 2009 at 08:13:59PM -0400, Kyle S Hoyt wrote:
> I have tried
> 
> ssh myname@myhost sg mygroup -c myprog --display mydisplay:0 -myparam 5
> ssh myname@myhost "sg mygroup -c myprog --display mydisplay:0 -myparam 5"
> ssh myname@myhost sg mygroup -c "myprog --display mydisplay:0 -myparam 5"
> ssh myname@myhost sg mygroup -c 'myprog --display mydisplay:0 -myparam 5'
> 
> And other combinations. (It also doesn't work for rsh). I lose the command 
> line parameters for myprog.

ssh myname@myhost "sg mygroup -c 'myprog ...'"

should work.  The key is you need to preserve the inner quotes long enough
to pass them along through the ssh to the remote shell.  In all the tries
you showed here, your quotes are stripped out by the local shell.  You need
a second set of quotes, or you need to escape the quotes with backslashes,
to keep them around long enough.

[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux