LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2003, 08:49 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
SSH - X server connection problem


Hi folks,

I have 2 boxes connected with a crossover cable for broadband sharing. Both of them can ping to each other. Broadband sharing has no problem.

PC1 - RH9
eth0 - connected to broadband
eth1 - connected to PC-2, IP 192.168.0.1

PC2 - Gentoo box
eth0 - connected ot PC-1, IP 192.168.0.2


On PC1-RH9
==========
I could "ssh -l root 192.168.0.1" and start applications of PC2-Gentoo box displaying them on screen.

But I could not make it the other way round, i.e.

On PC2-Gentoo
=============
# ssh -l root 192.168.0.1
root@192.168.0.1's password:
Last login: Fri Nov 7 16:06:41 2003 from 192.168.0.2
[root@localhost root]# konqueror
konqueror: cannot connect to X server

Kindly advise how to fix this problem. Thanks in advance.

B.R.
satimis
 
Old 11-07-2003, 10:36 AM   #2
bitva
Member
 
Registered: Dec 2002
Location: Los Angeles
Distribution: Debian
Posts: 72

Rep: Reputation: 15
Take a look at PC1's sshd_config file. Make sure X11Forwarding is set to yes. If not, make the change and restart SSH. Also, try adding the -X option:

ssh -X root@192.168.0.1
 
Old 11-07-2003, 09:02 PM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally posted by bitva
Take a look at PC1's sshd_config file. Make sure X11Forwarding is set to yes. If not, make the change and restart SSH. Also, try adding the -X option:

ssh -X root@192.168.0.1
Hi,

Now my problem changed.

PC1-Gentoo box could connect X-server of PC1-RH9 box. But PC1-RH9 box could NOT connect X-server of PC2-Gentoo box]

On PC1-RH9 box
# ssh -X root@192.168.0.2
ssh: connect to host 192.168.0.2 port 22: Connection refused
# ssh -l root 192.168.0.2
ssh: connect to host 192.168.0.2 port 22: Connection refused

Port 22 seemed locked permanently.

Ping PC2 was OK

Both abovementioned commands worked on PC2-Gentoo box

It looks a little bid funny to me. I have not touched any files on both boxes since last posting except turning off both boxes for a while.

I was searching to temporarily stop iptables on PC2-Gentoo box without result.

B.R.
satimis
 
Old 11-09-2003, 04:18 AM   #4
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi all,

Finally I discover the cause of the problem but still there are some minor problems remained unsolved.


PC1-RH9 box
==========
Recently I am testing Shorewall 1.4.7 on this box so that there are 2 firewalls, Shorewall and Iptables, running on the same box but without conflict. I have configured Shorewall 1.4.7 including IP masquerading leaving Iptables untouched as default firewall eversince the intallation of RH9.

After stopping Iptables
# /etc/init.d/iptables stop

Then PC1-RH9 box, both as ROOT and USER, can connect both ROOT's and USER's X-server of PC2-Gentoo box.


PC2-Gentoo box
============
This box also has 2 NICs
eth0 connected to broadband via ADSL modem when it works as standalone workstation. At time of testing SSH there is no connection

eth1 connected to PC1-RH9 box

If I add 'adsl-start' in /etc/conf.d/local.start, this box can't connect X-server of PC1-RH9 box (however login to PC1-RH9 box being possible). I have to remove it from /etc/conf.d/local.start. In the recent test I added it to reconfirm this discovery.

Now another minor problem popup after removing 'adsl-start' at finish of the aforesaid reconfirmation. As ROOT PC1-Gentoo box can't connect X-server of PC1-RH9 box (login being possible)

# ssh -l root 192.168.0.1
root@192.168.0.1's password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
Last login: Sun Nov 9 16:53:10 2003 from 192.168.0.2

# konqueror
Xlib: connection to "localhost:11.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
konqueror: cannot connect to X server localhost:11.0

# kedit
Xlib: connection to "localhost:11.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key
kedit: cannot connect to X server localhost:11.0

But as USER PC2-Gentoo box can connect X-server of PC1-RH9 box.


My new questions are;

1) How to configure Iptables so that it can coexist with Shorewall without affecting SSH
2) How to solve the remaining problem in PC2-Gentoo box as mentioned above

Thanks in advance.

B.R.
satimis
 
Old 04-28-2004, 03:10 PM   #5
labradog
LQ Newbie
 
Registered: Mar 2004
Distribution: ubuntu
Posts: 29

Rep: Reputation: 15
I was wondering if you have ever resolved this problem. I just started getting it since I upgraded to the latest mandrake version. I have several linux boxes but only the 2 i upgraded to mandrake 10 are having exatly the same problem you describe in the last post.
Xlib: connection to "localhost:11.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key

Brian
 
Old 04-29-2004, 02:29 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally posted by labradog
I was wondering if you have ever resolved this problem. I just started getting it since I upgraded to the latest mandrake version. I have several linux boxes but only the 2 i upgraded to mandrake 10 are having exatly the same problem you describe in the last post.
Xlib: connection to "localhost:11.0" refused by server
Xlib: Invalid MIT-MAGIC-COOKIE-1 key

Brian
Hi,

I recalled that I solved the problem finally which happened sometime ago. Now I'm not on Redhat and Gentoo any more, having migrated to FreeBSD. Sorry I could not give you suggestion.

B.R.
satimis
 
  


Reply



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
SSH connection in graphical mode (X-Server?) max2004 Linux - Networking 12 01-25-2012 05:19 AM
SSH connection through companies proxy server rydl Linux - Networking 2 10-26-2005 09:08 AM
ssh connection closed by server m_yates Linux - Security 3 08-10-2005 03:12 PM
why ssh server is closing the connection just after successful login puru_09 Linux - Networking 0 03-30-2004 12:25 AM
Game server shutting down when I close my SSH connection jader9920 Linux - Software 7 01-05-2004 07:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:14 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
Open Source Consulting | Domain Registration