Fedora Linux Support Community & Resources Center
  #1  
Old 14th October 2004, 08:04 AM
mic_ Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Newbie: X-session with ssh

Hi all,

Here I am new to the networking world. My problem is as follows.

I have a Linux Enterprise computer and a Fedora Laptop. I would like to open a remote X-session using ssh (client: Fedora Laptop / server Lin. Ent. computer).

I understand that once I logged into the server with ssh, their should not be any problem opening an X session. However, after succeding in logging in, that's what I get:

[mic_@client mic_]$ ssh server_IP
mic_@server's password:
[mic_@server mic_]$ xeyes &
[1] 6847
[mic_@server mic_]$ _X11TransSocketINETConnect: Can't get address for localhost
Error: Can't open display: localhost:10.0

[1]+ Exit 1 xeyes


It seems that somehow, the server thinks the client is called locallhost, which iis not the case as far as I know, since the HOSTNAME entry of /etc/sysconfig/network is client_name, and not localhost.

I would be gratefull if someone could help me use a remote X terminal, through ssh.

Thanks,

Michel
Reply With Quote
  #2  
Old 14th October 2004, 08:22 AM
superbnerd
Guest
 
Posts: n/a
You really ouhgt to read the man pages for anything before you use it. This is a golden rule for linux (rtfm).

The swtich you want is -X.
Code:
ssh -X user@host
You should also make sure the sshd server has enabled X forwarding.
Reply With Quote
  #3  
Old 14th October 2004, 12:20 PM
mic_ Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Hi, thanks for the answer.

As a matter of fact, I did read the man pages, and the X11forwarding appears to be on (ForwardX11 yes in /etc/ssh/sshd_config). What you proposed still does not work, here's what I get:

[mic_@client root]# ssh -X mic_@server
mic_@server's password:
[mic_@server mic_]$ xeyes &
[1] 7081
[mic_@server mic_]$ _X11TransSocketINETConnect: Can't get address for localhost
Error: Can't open display: localhost:10.0

[1]+ Exit 1 xeyes


As I said previously, one thing I was thinking is that the server does not get the correct local host name (Error: Can't open display: localhost:10.0 from above). In particular, the client hostname is not localhost, but client, and I don't know where this comes from. Are there particular configuration files that should be checked ?

Thanks,
Michel
Reply With Quote
  #4  
Old 14th October 2004, 12:43 PM
olivierv Offline
Registered User
 
Join Date: Aug 2004
Posts: 124
when you type
Code:
echo $DISPLAY
what's the returned value? If it's blank, you need to set it. You may also want to try xhost + and then try again. If it works, the problem is with security issues (don't forget to do xhost - when done to re-enforce security).

Last edited by olivierv; 14th October 2004 at 12:46 PM. Reason: I realize this is vague, but if you let me know what the above does then I'll go into more detail then instead of trying to cover all the bases now.
Reply With Quote
  #5  
Old 14th October 2004, 01:54 PM
mic_ Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
ok, it still doesn't work: I typed xhost + in the client (and the server as well), and set DISPLAY as follows
Quote:
[mic_@client mic_]# ssh -X mic_@server_IP
mic_@server_IP's password:
[mic_@server_IP mic_]$ echo $DISPLAY
localhost:10.0
[mic_@server mic_]$ export DISPLAY=client_IP:0.0
[mic_@server mic_]$ echo $DISPLAY
client_IP:0.0
[mic_@server mic_]$ xeyes &
[1] 7186
[mic_@server mic_]$ Error: Can't open display: client_IP:0.0

[1]+ Exit 1 xeyes
so it still doesn't work ...
Reply With Quote
  #6  
Old 14th October 2004, 02:13 PM
olivierv Offline
Registered User
 
Join Date: Aug 2004
Posts: 124
Ok,

Try setting $DISPLAY to :0.0 or :10.0 omitting the localhost or IP prefix. What version of Linux is on the server? RHEL?

Also, are you root when you ssh to the server? Are you root during any of this? I know that, for example, Suse doesn't automatically configure root to have X access after an su or su- (at least on Suse 9 and 9.1) and I've always had to do an export DISPLAY=:10.0 before running any X application as root.
Reply With Quote
  #7  
Old 14th October 2004, 02:52 PM
mic_ Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
Many thanks for your answers. The server is RHEL WS, the client Fedora 2.
I tried everything as root and as a user, to no avail ...
This is what I typed:

Quote:
[mic_@client mic_]$ ssh -X mic_@server_IP
mic_@server_IP's password:
[mic_@server mic_]$ echo $DISPLAY
localhost:10.0
[mic_@server mic_]$ export DISPLAY=:10.0
[mic_@server mic_]$ echo $DISPLAY
:10.0
[mic_@server mic_]$ xeyes &
[1] 7706
[mic_@server mic_]$ Error: Can't open display: :10.0

[1]+ Exit 1 xeyes
[mic_@server mic_]$
I also tried setting DISPLAY to :0.0, but still doesn't work, although the error message is different:
Quote:
[mic_@server mic_]$ export DISPLAY=:0.0
[mic_@server mic_]$ echo $DISPLAY
:0.0
[mic_@server mic_]$ xeyes &
[1] 7707
[mic_@server mic_]$ Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: :0.0

[1]+ Exit 1 xeyes
[mic_@server mic_]$
any more ideas ?
Reply With Quote
  #8  
Old 14th October 2004, 04:26 PM
olivierv Offline
Registered User
 
Join Date: Aug 2004
Posts: 124
Can you try setting $DISPLAY to :0.0 again and running xhost + on your FC2 box before logging in using ssh? Make sure you run xhost + as whatever user you're logged in to X as.

So:
Code:
xhost +
ssh -X rhelws_ip -l your_username
export DISPLAY=:0.0
xeyes
If that doesn't work, try the last 2 steps with the previously mentioned DISPLAY values. When done, "exit" ssh and do a xhost +.
Reply With Quote
  #9  
Old 14th October 2004, 11:48 PM
superbnerd
Guest
 
Posts: n/a
Here is the easy solution:
1) Use command gdmsetup, Main Menu > System Settings > Login
2) Click the last tab XDMCP
3) Enable XDMCP
4) Enable Honour nderect request, the defaults should be acceptable for now
5) Click the Security tab
6) Uncheck the "Always disallow TCP connection to X server (disable all remote connection)"

As a security messure, you should never allow root to login to ssh remotely. Make sure this option is in yout /etc/ssh/sshd_config
Code:
PermitRootLogin no
To become root remotely, first login with a normal user. Then use the "su -" command to become root. You should also consider allowing only a certain user or group login remotely.
Reply With Quote
  #10  
Old 15th October 2004, 05:56 AM
mic_ Offline
Registered User
 
Join Date: Oct 2004
Posts: 7
OK, finally it works ! Many thanks to both. I tried different combinations that you guys suggested. What was required was setting DISPLAY and the correct the login parameters (XDMCP, security etc.)
So I guess I'll have to fiddle with the configuration files to have the DISPLAY settings done automatically.

Here's what finally worked:
Quote:
[mic_@client mic_]$ ssh -X mic_@server_IP
mic_@server_IP's password:
[mic_@server mic_]$ export DISPLAY=client_IP:0.0
[mic_@server mic_]$ xeyes &
[1] 18521
[mic_@server mic_]$

Last edited by mic_; 15th October 2004 at 06:12 AM.
Reply With Quote
Reply

Tags
newbie, ssh, xsession

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Session failed with 'Your session only lasted less than 10 seconds bla bla...' ffhjeon Using Fedora 2 12th July 2008 10:14 AM
gnome-session-properties -> session list fleshm Using Fedora 0 27th June 2007 10:04 AM
PHP Session ID (newbie) weaved Using Fedora 4 19th March 2005 02:13 PM


Current GMT-time: 08:28 (Tuesday, 25-04-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat