Export DISPLAY Back to FreeNX Server [CentOS 5.3]
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:
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.
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:
change this to
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 12:28 PM.|