LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Export DISPLAY Back to FreeNX Server [CentOS 5.3] (https://www.linuxquestions.org/questions/linux-software-2/export-display-back-to-freenx-server-%5Bcentos-5-3%5D-717790/)

Chryzmo 04-08-2009 03:51 PM

Export DISPLAY Back to FreeNX Server [CentOS 5.3]
 
Hello,

I set up FreeNX on one of my Linux boxes today running CentOS 5.3. I am using NX Client for Windows to connect to this machine. For the most part, everything seems to be running nicely and surprisingly fast.

However, when I connect to the FreeNX server, then ssh to another server, I cannot export my DISPLAY back to the FreeNX server. Is there a way to get this to work? I have confirmed that if I'm physically at the box, I can ssh and export my DISPLAY back without an issue, it only seems to be when I'm connected to FreeNX.

Example of what I've tried:

Code:

[on FreeNX server]
(The title bar describes this session as chryzmo@servername:1000)
$ xhost +
access control disabled, clients can connect from any host
$ echo $DISPLAY
:1000.0

$ssh secondbox
chryzmo@secondbox's password:
$ export DISPLAY=10.0.0.88:1000.0
$ xterm
(There is a 5-10 second pause here)
xterm Xt error: Can't open display: 10.0.0.88:1000.0

Does anyone know if there is a way to export your DISPLAY back to a FreeNX server?

Thanks,
chryzmo

MensaWater 04-09-2009 09:19 AM

Don't use xhost if you have ssh. It is very insecure. Instead use ssh forwarding instead.

When you open the connection do "ssh -x host" instead of just "ssh host". This sets the DISPLAY to vi a special value on localhost and that value is then used to push the X traffic back over your ssh connection (which is secure).

Also make sure you aren't setting DISPLAY value in your bashrc, bashprofile etc... as it will override the DISPLAY the ssh forwarding is trying to use. With this you no longer need to use xhost on server to allow traffic as X never sees that the traffic is going anywhere but to the local server.

Type "man ssh" for more details.

Also note that this setting only applies for the user you logged in as. If you su to another user (e.g. "su -" to become root) the new user doesn't inherit. You just need to manually set DISPLAY for new user to same as original then set variable XAUTHORITY=<homedir_of_original_user>/.Xauthority. For any user other than root you'd also have to change permissions of the .Xauthority file as only the original user can read it.

Chryzmo 04-09-2009 09:57 AM

Thank you for your response. Normally I would not use xhost +, I was just getting frustrated that I could not get this working. I was attempting to limit possible causes of the issue.

It turns out that in /etc/nxserver/node.conf there is a line:
#AGENT_EXTRA_OPTIONS_X="-no-tcp"
change this to
AGENT_EXTRA_OPTIONS_X=""

Then restart the freenx-server and X forwarding should work. My problem was assuming that because it was commented out, there was a different default.


All times are GMT -5. The time now is 03:08 PM.