Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .