1

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?

1 Answer 1

1

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"

You can also set it permanently in ~/.ssh/config by setting ForwardX11 yes.

1
  • 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. Jul 21, 2012 at 22:57

You must log in to answer this question.

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