using X across an ssh connection - how?
I'm trying to use X Windows across an ssh connection. It's an ssh connection I've used for a long time for normal terminal command line connections so I can ctually make the connection successfully with no problem. To try and use X I've changed the command line from 'ssh -x <remote>' to 'ssh -X <remote>'. The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, 'echo $DISPLAY' produces nothing. What am I doing wrong? -- Chris Green (chris@areti.co.uk) "Never ascribe to malice that which can be explained by incompetence."
On Thu, Apr 14, 2005 at 09:29:00PM +0100, Chris Green wrote:
The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, 'echo $DISPLAY' produces nothing.
What am I doing wrong?
Does the remote end have the option "X11Forwarding yes" in the /etc/ssh/sshd_config file? Adam -- jabberid = quinophex@jabber.earth.li AFFS || http://www.affs.org.uk/ || Not a filesystem
Chris Green wrote:
The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, [...]
I think that you may need to change a sshd_config setting on the machine you are connecting to. -- Hope that helps, MJR/slef http://mjr.towers.org.uk
On Thursday 14 April 2005 22:50, MJ Ray wrote:
Chris Green wrote:
The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, [...]
I think that you may need to change a sshd_config setting on the machine you are connecting to. If you want to try setting it up manually, you need to do the following:
xhost +<host or ip of remote machine> ssh <host or ip of remote machine> at the command prompt on the remote machine type: export DISPLAY=<ip or host of local machine>:0 now try running an X app, such as firefox. It should appear on your local machine. Stuart. -- --------------------------------------- Stuart Bailey BSc (hons) CEng CITP MBCS LinuSoft (Proprietor) (01953) 601294 (07778) 383739 http://www.linusoft.co.uk ---------------------------------------- ********************************************************************** This email and any files transmitted with it are confidential. If you are not the intended recipient, please email postmaster@linusoft.co.uk immediately. You should not copy or use this email or attachments for any purpose nor disclose their contents to any other person. NO BINDING CONTRACT WILL RESULT FROM THIS E-MAIL UNTIL SUCH TIME AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF LinuSoft. LinuSoft cannot accept any responsibility for the completeness or accuracy of this message as it has been transmitted over public networks. *************************************************************************
On Fri, Apr 15, 2005 at 08:57:08AM +0100, Stuart Bailey wrote:
On Thursday 14 April 2005 22:50, MJ Ray wrote:
Chris Green wrote:
The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, [...]
I think that you may need to change a sshd_config setting on the machine you are connecting to. If you want to try setting it up manually, you need to do the following:
xhost +<host or ip of remote machine> ssh <host or ip of remote machine>
at the command prompt on the remote machine type: export DISPLAY=<ip or host of local machine>:0
I don't think the above is right, the ssh man page explicitly says that one should *not* set the DISPLAY variable as ssh does it for you. I'm not sure if the xhost is necesary either but if it is that should be clear from error messages. -- Chris Green (chris@areti.co.uk) "Never ascribe to malice that which can be explained by incompetence."
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Stuart Bailey <stuart@linusoft.co.uk> wrote:
If you want to try setting it up manually, you need to do the following:
xhost +<host or ip of remote machine> ssh <host or ip of remote machine>
at the command prompt on the remote machine type: export DISPLAY=<ip or host of local machine>:0
now try running an X app, such as firefox. It should appear on your local machine.
Ewww, naughty. For the following reasons, this is a bad idea: 1) X traffic, in this set up, is not going over the SSH link, it's being thrown over the network in the usual X11 protocol, which isn't encryted 2) Not all X Servers default to running network X11, infact, some distros positively disable it. 3) The traffic is uncompressed, and so slow. The correct way, as already noted on the thread, is to enable X11 forwarding on the ssh server. Thanks, - -- Brett Parker web: http://www.sommitrealweird.co.uk/ email: iDunno@sommitrealweird.co.uk -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCX3pvEh8oWxevnjQRAo4XAJ4stAdj449KAvF75H5up8fO23JG2wCgtm8g RSBc+mvopCR3jSw7WQ8PAYU= =tx4n -----END PGP SIGNATURE-----
On Fri, Apr 15, 2005 at 09:25:19AM +0100, Brett Parker wrote:
Stuart Bailey <stuart@linusoft.co.uk> wrote:
If you want to try setting it up manually, you need to do the following:
xhost +<host or ip of remote machine> ssh <host or ip of remote machine>
at the command prompt on the remote machine type: export DISPLAY=<ip or host of local machine>:0
now try running an X app, such as firefox. It should appear on your local machine.
Ewww, naughty. For the following reasons, this is a bad idea:
1) X traffic, in this set up, is not going over the SSH link, it's being thrown over the network in the usual X11 protocol, which isn't encryted
2) Not all X Servers default to running network X11, infact, some distros positively disable it.
3) The traffic is uncompressed, and so slow.
Not to mention that it won't work for me (I hadn't noticed that all that was being suggested was a 'normal' X setup, just happening to use ssh to get to the remote machine to run the app). These ssh links I'm using are specifically permitted ports through our firewall to and from specific machines to allow me to access work machines from home. Most ports are blocked. -- Chris Green (chris@areti.co.uk) "Never ascribe to malice that which can be explained by incompetence."
Chris Green <chris@areti.co.uk> writes:
To try and use X I've changed the command line from 'ssh -x <remote>' to 'ssh -X <remote>'.
The ssh man pages say that ssh will set the DISPLAY environment variable but it doesn't seem to do so, 'echo $DISPLAY' produces nothing.
What am I doing wrong?
People have suggested some possibilities. Using "ssh -v" is often useful when debugging SSH problems, so try that and see what (if anything) it says about X forwarding (in amongst everything else). -- http://www.greenend.org.uk/rjk/
participants (6)
-
Adam Bower -
Brett Parker -
Chris Green -
MJ Ray -
Richard Kettlewell -
Stuart Bailey