Xforwarding question

Tony Arnold tony.arnold at manchester.ac.uk
Fri Apr 12 07:32:30 UTC 2013


Linda,

On 12/04/13 02:29, Linda wrote:
> On 04/11/2013 04:25 PM, Tony Arnold wrote:
>> Linda,
>>
>> On 11/04/13 20:25, Linda wrote:
>>> I am playing around with X11 forwarding.
>>> When I use ssh -X and I am done and exit if I have displayed a remote
>>> graphical program instead of exit giving me logout then connection
>>> closed then a prompt on the local machine I get a response of logout
>>> but no connection closed and have to enter ctrl C to return to the
>>> prompt
>>> I notice the same behavior with Xming and Putty from windows, ie not
>>> a clean exit so you have to manually close putty. Just wondering what
>>> I need to do to properly close everything when running remote X
>>> applications over ssh or putty.
>> It sounds like your graphical program has not exited and so the
>> connection does not get closed. How are you invoking the program? Are
>> you putting an & at the end of the command to run it in the background?
>> E.g.,
>>
>>     $ xclock &
>>
>> Regards,
>> Tony.
> 

> Why does the graphical window need to run in the background? Just
> thinking about future uses. Normally all of my commands are called via
> menus if they have to be called differently when accessed via ssh -X
> than when accessed directly from the server is there a way to know if a
> user has logged in via ssh so they can be given a different menu?

It doesn't have to, it's just convenient. By running in the background
it frees up the terminal for other things.

Once your application has run, then before you logout, you could use
pgrep or ps to find out if anything is still running in the background.
Might give you a clue.

Regards,
Tony.
-- 
Tony Arnold,                        Tel: +44 (0) 161 275 6093
Head of IT Security,                Fax: +44 (0) 705 344 3082
University of Manchester,           Mob: +44 (0) 773 330 0039
Manchester M13 9PL.                 Email: tony.arnold at manchester.ac.uk




More information about the ubuntu-users mailing list