[Gllug] RuntimeError: could not open display

Tet tethys at gmail.com
Thu May 4 09:47:52 UTC 2006


On 5/4/06, Jim Bailey <jim at freesolutions.net> wrote:

> I have this script in by .bash_profile which should if I understand it
> properly allow me to display remote X progs.
>
> # take your display with you at remote login:
> # Put it into your ~/.bash_profile
> whoami=`who -ml`
> remhost=`expr "$whoami" : '.*(\(.*\))'`
> if [ -n "$remhost" ]; then
> DISPLAY="$remhost":0.0
> export DISPLAY
> fi

Just get rid of that altogether. In theory, it should work (and in
years gone by, it would have done). Nowadays you'll need to set up X
authentication properly, otherwise it will fail. As you mention, ssh
already does this transparently for you, so it's a much better bet.

You just need to ensure that on the remote host, you have
"X11Forwarding yes" in /etc/ssh/sshd_config, and you can then do:

ssh -Y remotehost

Every X application you then run on the remote machine will be sent
bak to your local display over the ssh session. If you want to avoid
having to type the -Y each time, you can make it the default by
putting the following in /etc/ssh/ssh_config on the local machine:

Host *
  ForwardX11Trusted yes

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list