Re: x-forwarding with ssh
A couple of comments.
1. If you have root access on the server machine, you can edit the ssh_config
and sshd_config files to turn on X11Forwarding. You should also do that on your
If this is done, I have had it the case that X forwarding has not required
setting up the DISPLAY variable. In other cases I have had to. I really don't
understand why these are sometimes different.
2. In the reply below, it is assumed that you are using the bash shell. For
those of us that prefer tcsh (or csh) the DISPLAY command is
setenv DISPLAY server.machine.edu:0
The :0 simply gives access to the root window on your machine.
On Fri, Mar 01, 2002 at 01:28:40PM +1030, Tom Cook wrote:
> Nick Wright wrote:
> > Hi there.
> > Currently when I try to run X apps via an ssh login I get the error message
> > xterm Xt error: Can't open display:
> > Is this a problem with ssh and my x-forwarding?
> > if so, how do you change the x-forwarding options in ssh?
> > if not, what is the problem and how do I fix it? :)
> It doesn't sound like a problem with ssh to me, it sounds like you
> haven't set the DISPLAY variable correctly, and therefore probably
> haven't run xhost either.
> desk.host: # xhost +remove.host.domain.com
> desk.host: # ssh -X remote.host.domain.com -l myaccount
> email@example.com's password: ********
> remote.host: # export DISPLAY=desk.host:0.0
> remote.host: # xterm &
> That should do it.
> Mind you, DISPLAY seems to get set correctly on my box automagically,
> but I don't know how it goes about that.
> To UNSUBSCRIBE, email to firstname.lastname@example.org
> with a subject of "unsubscribe". Trouble? Contact email@example.com