LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-03-2007, 11:19 AM   #1
froza
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Rep: Reputation: 0
Slackware 12 - ssh X11 Fowarding issue


Hi People, I've troubles with X11Forwarding with slack

Y have ssh_config setting with
Host *
ForwardX11 yes
I do a xhost +

I connect a server with ssh -X -p PORT user@server

I do an export DISPLAY=ip:0

then y run for example xterm

and say... can't open DISPLAY ip:0

From another Linux, other than slackware 12, I do the same, and the xterm it's been exported... also if I connect from slackware and set the DISPLAY to the ip of another linux. It's appear than the Xserver of slackware don't accept the export window... Is there any security issue than could be giving me problems?

The slackware installation its a full...

Any HELP?
 
Old 10-03-2007, 12:13 PM   #2
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
you don't have to do export DISPLAY... if you have the X11 forwarding setup correctly. It is auto set ..

Make sure that you have edited sshd_config and not ssh_config (dumb, but a common problem as the files are in the same dir).

restart sshd and do

ssh -X localhost
bash$: echo $DISPLAY
localhost:10.0


Note how $DISPLAY is auto set to ip:10 (the value 10 is again decided by the sshd_config.

also note that X11 should be compiled with listen on port 6000 . (basically nmap localhost and check that port 6000 is open).
 
Old 10-03-2007, 01:47 PM   #3
froza
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Hi! Thanks for the answer...

After doing some tests.. i get working the X11 foward but only if I stay with the user that i Logon....
Look this... Here I made a connection to the server, and try to run xclock, this works fine... but when I do a su - root or to another user.. the DISPLAY doesn't work anymore... how i can solve this?

[d4so@WS118942 ~]$ xclock
[d4so@WS118942 ~]$ su - root
Password:
[root@WS118942 ~]$ xclock
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
 
Old 10-03-2007, 04:21 PM   #4
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Try with non root user. Root connection must have been disabled. Still same problems?
 
Old 10-04-2007, 05:59 AM   #5
duryodhan
Senior Member
 
Registered: Oct 2006
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054

Rep: Reputation: 46
also try
echo $DISPLAY
su
export DISPLAY=<what you got previously>


maybe that will work .....
 
Old 10-04-2007, 06:00 PM   #6
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 68
X11 Fowarding must be enabled in /etc/ssh/sshd_config on ssh server computer. (note the d this is the server the other is the client).

Once this is changed it should automagicly set the correct DISPLAY

Last edited by XGizzmo; 10-04-2007 at 06:02 PM.
 
Old 10-05-2007, 07:11 AM   #7
froza
LQ Newbie
 
Registered: Oct 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Hi to All, for the help.. I tried all that you says... but still have thse same problem... i couldn't export display, with export and xhost..

I follow a post that i found, and finally i get it.

I need to modify the the login window, don't ask me why...

if I use xdm, modify de Xaccess, and all the files of xdm, same in the case of kdm and gdm... modify the conf files.... is the only way that I found to make it works.

Thanks for the help guys!
 
Old 10-05-2007, 07:36 AM   #8
Dinithion
Member
 
Registered: Oct 2007
Location: Norway
Distribution: Slackware 14.1
Posts: 446

Rep: Reputation: 59
What you are using now is XDMCP and is slower (my experience) then ssh X forward.

Be sure to check this one more time.

Step 1:
On the server (the one with the ssh daemon) make sure these lines are in /etc/ssh/sshd_config (As mentioned this is not the same file as the clients /etc/ssh/ssh_config):
These are the lines of my (working) config:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
XAuthLocation /usr/bin/xauth

Step 2:
Restart the sshd.

Step 3:
on the client (the one you connect from):
This line must be uncommented or added to /etc/ssh/ssh_config (Clients config file. Not the same as daemon config file)
ForwardX11 yes

Now, as you have made the config right, start a ssh connection to your server. This ssh connection must be done from a virtual terminal inside an already existing X session. Many people believe they can start an X window from the tty. That wont work. So before you start the SSH-connection start a dedicated X-session (If you wish so) xinit -- :2 for example, or login using startx to your local X.

Step 4:
Noe ssh -XC username@server or ssh -YC username@server (Try both. If it doesn't work. The C is just compression)
Try starting a graphical app. xeyes or something funny.

Step 5: (If it doesn't work)
If no one of them work try exit the ssh connection, and make sure you are bare on the client computer. Try adding xhost: xhost +hostname_of_server. I.E. xhost +192.168.1.1 or whatever you want to ssh to.

Step 6: (If it doesn't work)
Retry connection from step 4.

If all this is done right, I can't se why it shouldn't work. But if it works, you can start an entire windowmanager, startkde or gnome-session.

Edit:

Wops, I made a huge response to a problem you had fixed. I didn't realize the problem was su in a working X forward session.

Last edited by Dinithion; 10-05-2007 at 07:42 AM.
 
Old 11-02-2007, 06:27 PM   #9
sn9ke_eyes
Member
 
Registered: Feb 2003
Location: Texas
Distribution: slackware 11
Posts: 90

Rep: Reputation: 15
Quote:
Originally Posted by froza View Post
Hi to All, for the help.. I tried all that you says... but still have thse same problem... i couldn't export display, with export and xhost..

I follow a post that i found, and finally i get it.

I need to modify the the login window, don't ask me why...

if I use xdm, modify de Xaccess, and all the files of xdm, same in the case of kdm and gdm... modify the conf files.... is the only way that I found to make it works.

Thanks for the help guys!
What post did you follow ?
 
Old 05-30-2008, 05:05 PM   #10
jlarsen
Member
 
Registered: Jan 2005
Location: Dallas, TX
Distribution: Slackware 14.1
Posts: 79

Rep: Reputation: 15
Based on the info in this thread I was able to get this working....except I need to take it a step further and am having trouble.

Xforwarding is on and working, and I have shared keys between the machines for automated login. There are two programs running, for this example say I am running xeyes along with another program checkeyes. xeyes runs on a remote server and forwards the display over ssh to my computer. This part works fine when I start xeyes from within the kde session with the command:
ssh -Y xxx.xxx.xxx.xxx xeyes
Note all of this is done under myuser
The problem comes when trying to run the program checkeyes as root (or even as myuser). Check eyes runs constantly and looks to see if xeyes quit running, and restarts it if needed with the command:
su myuser -c ssh -Y xxx.xxx.xxx.xxx xeyes

when it tries to run it gives:
Error: Can't open display:
I don't see anything in /var/log/Xorg.0.log
My guess is some kind of environment issue, but I'm not sure how to figure it out.

Anyone still reading after all this, thanks for the help.

Last edited by jlarsen; 05-30-2008 at 05:08 PM. Reason: thinking about happy hour instead of typing the right information
 
Old 06-02-2008, 04:08 PM   #11
jlarsen
Member
 
Registered: Jan 2005
Location: Dallas, TX
Distribution: Slackware 14.1
Posts: 79

Rep: Reputation: 15
In case anyone is curious I got this to work as follows:

Program checkeyes (running as daemon) calls a startup script if it sees that xeyes is not running with the command:
su myuser -c /home/myuser/rc.xeyes
rc.xeyes looks like this:
#!/bin/bash
export DISPLAY=:0.1
ssh -Y xxx.xxx.xxx.xxx xeyes
#
I guess because this is started outside of the X environment you have tell it where to send the display.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sudo and ssh X11 fowarding Mike_the_Man Linux - General 1 05-03-2006 11:04 PM
Port fowarding through ssh without setting up the router, possible? Baix Linux - Newbie 7 02-11-2005 09:51 PM
Slackware 8.1 X11 keyboard issue eth0holic Slackware - Installation 1 09-27-2004 01:18 AM
X11 fowarding Atlas337 Linux - Software 2 08-10-2002 09:04 PM
SSH port fowarding magyartoth Linux - Networking 10 05-01-2002 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration