On Sun, 14 Aug 2016 14:52:19 -0400, Barry Margolin wrote:
> In article <542sz.55352$4a5....@fx16.iad>,
> Icarus Sparry <
i.spa...@gmail.com> wrote:
>
>> On Fri, 12 Aug 2016 14:32:03 +0000, j wrote:
>>
>> > Another related question: When I do 'ssh -X' into a remote shell, how
>> > to start an X application in the host of the Xserver (using the same
>> > Xserver display)?
>> >
>> > It should be possible because firefox by default when invoked under a
>> > 'ssh -X' session would start a firefox process running on the Xserver
>> > host (that option is overriden with the firefox -no-remote option).
>>
>>
>> Just start it!
>> The DISPLAY variable is set, usually to something like localhost:10 The
>> ssh session will be set up to tunnel tcp port 6010 back to your
>> original X server, and (assuming xauth can be found on the remote
>> machine) the authentication will have been copied over.
>
> That starts the program on the SSH server and displays it on the X
> server, it doesn't run the program on the X server host.
True, I misread the question.
The OP will need to run an application on the X server host which accepts
commands and executes them. One way to do this would be to use tcl/tk and
the "send" command.
So for a proof of concept, assuming that "wish" is installed on both the
ssh server and the X server, create a file on the X server, e.g. /tmp/
receiver, with the following contents
#!/usr/bin/env wish
tk appname hostcmd
pack [button .b -text "Exit hostcmd" -command exit ]
and then run on the X server "wish /tmp/receiver" in a terminal window.
It should create a button that you can press, leave this running.
On the ssh host, run "wish", and at the "% " prompt type
send hostcmd {puts [exec /bin/pwd]}
and observe that in the terminal window associated with the "wish /tmp/
receiver" it will run the /bin/pwd command, and output it on that
terminal. (The simpler "send hostcmd exec /bin/pwd" will run the /bin/pwd
command on the X server but send the output to the window assocated with
the ssh host).
This can be extended to, for example'
send hostcmd exec xterm -T OnXserver &
Sorry for the original answer.