Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to tell an already-running ssh session to forward X11 connections, if you've forgotten to supply -X on the command line? If so, how?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Not really; you'll want to disconnect and reconnect.

If you want to forward X sessions most of the time, then consider a bash alias such as:

alias ssh="ssh -X"
share|improve this answer
    
I was afraid of that. I tried setting up port forwardings from within ssh by using the escape character ~ after a newline, but I had no way to set up the Xauthority stuff. The main reason I haven't made such an alias until now is that every time I use ssh -X on Mac OS X, it delays for several seconds while it starts Xquartz at the beginning of the session. Since I don't usually need X I prefer not to forward it all the time. –  echristopherson Jul 21 '12 at 22:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.