[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Google
  Web www.spinics.net

Re: ssh and change group id



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.

[Home]     [Fedora Users]     [Fedora Legacy]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

Add to Google Powered by Linux