LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Xserver in fedora 17, displaying from remote server. (https://www.linuxquestions.org/questions/linux-newbie-8/xserver-in-fedora-17-displaying-from-remote-server-4175447708/)

mmcc0912 01-29-2013 10:53 AM

Xserver in fedora 17, displaying from remote server.
 
I'm working on switching from win* to linux as my desktop at work. The only thing I'm struggling with is how I get a servers display to mine. I'd run Xserver client in win*, from cmdline of linux server, I'd export the display to my desktop and launch away.

There is -X in ssh but I find it not working after several jump boxes. I find articles to modify the Xaccess file, but I'm not finding that. I have x11-server (and other x11-packages), gdm and Xdmcp installed. Am I just missing a package or did something change from the days of Xaccess settings?

I'd prefer to continue with the method of setting access restrictions since it's now an open port, if not start/stop a service for when required. I'd like to continue to set the display on the remote machine for sending displays back. I just feel I'm missing something that I'm not terming right for google/LQ.

Thanks..

goumba 01-29-2013 02:30 PM

-X pretty much works for me.

Try ssh with -Y then running the remote program from the shell prompt as you would locally. Does that work? Not a permanent solution, but something to try.

suicidaleggroll 01-29-2013 02:32 PM

As goumba said, it should be very straight forward:
Code:

$ ssh -Y server
$ program_name


mmcc0912 01-29-2013 05:18 PM

It doesn't when I ssh from server to server. I use -X on each one and it's not following the pathway back. I do the same thing on a win* VM and export display and it works using mochaX. I'm sure it's possible, but I can't find any Xaccess file on my fedora or how to make it to say, listen for inbound.

Thanks.

suicidaleggroll 01-29-2013 05:24 PM

I don't know what this Xaccess file is that you're looking for, is this something you had to use before? I've never seen or touched that file on my systems.

Code:

$ \ssh -X server3
$ \ssh -X server4
$ \ssh -X server5
$ \ssh -X server6
$ \ssh -X server7
$ \ssh -X server8
$ emacs

works fine for me. No DISPLAY setting, nothing at all, through a chain of 6 different Linux machines running a combination of Fedora and CentOS.

Could you use ssh -v to print more debugging output? What are the error messages you get when you try to launch an X application? Perhaps you placed something in your shell startup scripts to hard-code the DISPLAY for your previous win client?

mmcc0912 01-30-2013 12:37 PM

Thanks for all the help, just wanted to say that first of all.

The Xaccess I'm talking about, I'm several references such as http://www.cyberciti.biz/faq/howto-l...via-the-xdmcp/.

If verbose ssh helps, I'll run that. Here's the quick snip-it without.


Code:

[mmcc0912@desktop ~]$ ssh -X me@ogismgmt1.domain.com
me@ogismgmt1.domain.com's password:
Last login: Wed Jan 30 10:39:38 2013 from IP
[me@ogismgmt1 ~]$ ssh -X root@oraapps1-test
Last login: Tue Jan 29 20:47:19 2013 from IP
[root@oraapps1-test ~]# xclock
Error: Can't open display: localhost:0.0
[root@oraapps1-test ~]# echo $DISPLAY
localhost:0.0
[root@oraapps1-test ~]#

There are some things that I'm just not familiar with yet, I've spent all my time without a GUI. The method has always been to export the DISPLAY and send it where I wanted to see it. Everything I can find so far is the same as above link. Maybe I'm not searching with the correct words.

Thanks.

goumba 02-01-2013 08:09 AM

Ok, I misread your initial question, missing the fact you're ssh-ing from one point to another.

I just tried it here, and don't have a solution, but got a slightly different message:

Code:

root@serenity:~# emacs /etc/ssh/ssh_config
X11 connection rejected because of wrong authentication.
Display localhost:10.0 unavailable, simulating -nw

I don't know what you were thinking of, but rereading your question and following posts, you mention it works fine under Win. I was thinking the problem was at the server end, but perhaps it is at the local end. I hope this suggestion is of help to you.

Did you try doing the same using -Y instead of -X, just to see if it works?

mmcc0912 02-04-2013 09:50 AM

I did, but it doesn't make a difference.

Code:

# xclock
Error: Can't open display: 10.10.10.208:0.0

If I go to another server, look at the TCP it looks like this.

Code:

# netstat -an |grep ':600'
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                  LISTEN     
tcp        0      0 127.0.0.1:6001              127.0.0.1:32769            ESTABLISHED
tcp        0      0 10.51.1.210:6001            10.51.1.210:35687          ESTABLISHED
tcp        0      0 127.0.0.1:32769            127.0.0.1:6001              ESTABLISHED
tcp        0      0 10.51.1.210:35687          10.51.1.210:6001            ESTABLISHED

But when I look at my system/desktop, I get nothing.

Code:

[root@desktop ~]# netstat -an |grep ':600'
[root@desktop ~]#

It would have to be listening in some means to to accept connections. The remote server above is a RHEL 4.8 where my system is fedora17. I setup the remote system and installed nothing special, just Xserver and gnome.

Thanks for the attention to my post. I appreciate it. I've been googling it for some time and just haven't found the how do I make X listen that's applicable.

jpollard 02-04-2013 10:07 AM

Check the /etc/ssh/sshd_config. There should be a line in it (usually commented out):

#X11Forwarding no

This indicates that the default does not allow X windows to be forwarded to the remote user.

Uncomment (or duplicate the line, and uncomment) the line and change the "no" to "yes".

Restart the sshd server and you should be good to go.

goumba 02-05-2013 06:49 AM

Interesting, on my installation that comes set as yes as default.

I had missed that before, mmcc0912 in your case you're going to have to check the server config on every server along the way. Only one server having that set to "no" or commented out somewhere is going to stop you.

jpollard 02-05-2013 09:04 AM

In my system (Fedora 16 currently) it seems to show the default. But as it is a simple text file, it can show anything it wants. The only way to be sure (if it doesn't work) is to set it to "yes".

goumba 02-05-2013 10:37 AM

I should rephrase that. On an untouched Debian install of openssh-server, the line is uncommented and explicitly states
Code:

X11Forwarding yes
.

jpollard 02-05-2013 11:33 AM

sshd creates the X forwarding by opening a TCP port (6000+offset specified from sshd config file+increment to find unused port). That port is then passed to the X clients using the DISPLAY environment variable (value is localhost:<port-6000>.0). Any other value causes an access failure due to improper credentials.

The usual offset value is 10, to skip a possible 10 locally based TCP X servers. The first port used by sshd should then be 6010... with an increment of one for each sshd that may be forwarding that users X applications. The display environment value should be "localhost:10.0" for the first ssh login forwarding windows. 11.0 for the second.

The credentials should be shown by a "xauth list", one for each key. If you are logged in remotely, with X forwarding there would normally be only one key. It is possible to get multiple keys... just login a second time through another ssh login...

The fact that you have a DISPLAY value of other than localhost:10.0 (or 127.0.0.1:10.0) implies that some login script is forcing the environment value to a wrong number. DISPLAY is one of the few variables that should not be modified except for extremely good reasons - usually related to testing.

mmcc0912 02-05-2013 01:31 PM

I appreciate the responses, I can forward from the server to a windows host running an Xserver (mochaX). I can't find jack on how to enable Xserver in fedora to listen so that I can send the display back to my fedora box. Well, what I do find doesn't fit the system, the files it says to modify don't exist... Either something has changed, or I don't have the right packages installed, IMHO.

Right now I'm using mochaX in a TS/rdesktop session in windows. But my desktop has several monitors and it's just a functional thing to me that I should be able to send it directly to my desktop (Linux to Linux vs. Linux to Windoze).

Thanks.

suicidaleggroll 02-05-2013 02:12 PM

Quote:

Originally Posted by mmcc0912 (Post 4884980)
I appreciate the responses, I can forward from the server to a windows host running an Xserver (mochaX). I can't find jack on how to enable Xserver in fedora to listen so that I can send the display back to my fedora box.

It already is, there's nothing you have to do to make that happen. You should be able to install Fedora from scratch on two different machines, ssh -X from one machine to the other (assuming the sshd server is running on the destination machine), and open an X application without a problem.

As both myself and jpollard pointed out, your DISPLAY environment variable does not look correct. Are you SURE that you didn't hard-code anything in your log in scripts on the remote servers to force DISPLAY to some non-default value?


All times are GMT -5. The time now is 02:52 AM.