Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SSH problem again
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
satimis
Guru
Guru


Joined: 21 Oct 2003
Posts: 365

PostPosted: Tue Nov 11, 2003 2:09 pm    Post subject: SSH problem again Reply with quote

Hi folks,

Hardware configuration
=====================
Gentoo 1.4 box
eth0 for connecting to broadband via ADSL modem. At time of test no connection made
eth1 connected to RH9 box

RH9 box
eth0 connected to broadband via ADSL modem
eth1 conected to Gentoo box

Because of SSH being unstable in operation I upgraded it to the latest packages on RH9 box as follows;
openssh-3.7.1p2-1.i386.rpm openssh-clients-3.7.1p2-1.i386.rpm
openssh-askpass-3.7.1p2-1.i386.rpm
openssh-askpass-gnome-3.7.1p2-1.i386.rpm openssh-server-3.7.1p2-1.i386.rpm


After upgrade

On Gentoo box
===========
As USER ***

$ ssh -X satimis@192.168.0.1
satimis@192.168.0.1's password:
-bash-2.05b$ konqueror
konqueror: cannot connect to X server

$ ssh -X root@192.168.0.1
root@192.168.0.1's password:
Last login: Tue Nov 11 19:08:15 2003 from 192.168.0.2
[root@localhost root]# konqueror
konqueror: cannot connect to X server


As ROOT ***

# xhost + 192.168.0.1
xhost: unable to open display ""

# ssh -X satimis@192.168.0.1
satimis@192.168.0.1's password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
-bash-2.05b$

# ssh -X 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: Tue Nov 11 19:37:02 2003 from 192.168.0.2



On RH9 box
=========
As USER ***

$ ssh -X satimis@192.168.0.2
satimis@192.168.0.2's password:
Last login: Tue Nov 11 18:43:19 2003
satimis@localhost satimis $ konqueror
kbuildsycoca running...
DirFilterPlugin: New URL : file:/home/satimis
DirFilterPlugin: Current URL:
ASSERT: "m_widget" in kaction.cpp (2993)
ASSERT: "m_widget" in kaction.cpp (2993)

Connect to X-server of RH9 box without problem

$ ssh -X root@192.168.0.2
also no problem


As ROOT ***
# ssh -X satims@192.168.0.2
Permission denied (publickey,password,keyboard-interactive).
Could not login/connect X server of Gentoo box

# ssh -X root@192.168.0.2
root@192.168.0.2's password:
Last login: Tue Nov 11 18:53:51 2003 from 192.168.0.1
localhost root # konqueror
kbuildsycoca running...
DirFilterPlugin: New URL : file:/root
DirFilterPlugin: Current URL:
DirFilterPlugin: New URL : file:/
DirFilterPlugin: Current URL: file:/root
ASSERT: "m_widget" in kaction.cpp (2993)
ASSERT: "m_widget" in kaction.cpp (2993)
Connect to X-server of Gentoo box

I tried more than an hour to find out the cause of this funny things without result including rebooting PCs

/etc/ssh/sshd_config
Host *
ForwardX11=yes

found on both boxes. Also tried adding "ForwardAgent=yes"

Remark:
On Gentoo box - iptables not running
On RH9 box - iptables stopped running only Shorewall running
broadband sharing - OK

B.R.
satimis
Back to top
View user's profile Send private message
SZwarts
l33t
l33t


Joined: 13 Oct 2003
Posts: 629
Location: Sydney, NSW, Australia

PostPosted: Wed Nov 12, 2003 12:03 am    Post subject: Reply with quote

I'm not quite sure what your question is. I see a lot of logs with things you try but I do see no question in your entire post.
So if my answers don't cover your question, please ask the question.

Quote:

As USER ***

$ ssh -X satimis@192.168.0.1
satimis@192.168.0.1's password:
-bash-2.05b$ konqueror
konqueror: cannot connect to X server


I don't have a real idea from what you are doing here. If you type -X from a console, the remote PC tries to connect to the same DISPLAY as your previous shell, which might be empty.
So try echo $DISPLAY and before you ssh to see if it has anything
or do a
Code:

DISPLAY=192.168.0.2:0ssh -x <name>@<otherpc>

if you the computer you're trying from is 192.168.0.2 and has X running on 0...

Quote:

As ROOT ***

# xhost + 192.168.0.1
xhost: unable to open display ""

You probably su'ed from a normal user without copying the DISPLAY setting. So either you reverse the process first xhost +192.168.0.1 and then su or
Code:

su
Password:
DISPLAY=192.168.0.2:0 xhost +192.168.0.1

here root allows 192.168.0.1 to connect to the user session of 192.168.0.2:0

Hope this solves some of the mysteries you have, otherwise, you'd probably better of asking what you want, instead of only putting what you do.
Back to top
View user's profile Send private message
kwiqsilver
Guru
Guru


Joined: 19 Mar 2003
Posts: 360

PostPosted: Wed Nov 12, 2003 12:57 am    Post subject: Reply with quote

I get the idea you're trying to ssh from gentoo to redhat, then have the redhat box run konqueror and display it on your gentoo box, correct?
On the redhat box, there's a file /etc/ssh/sshd.config (or something like that) that has a few lines about X forwarding. They're probably commented out or set to "Off", turn them on and restart sshd.
If your gentoo box was able to display remotely through X already, you shouldn't need to change anything, but if you do, the file is something like /etc/ssh/ssh.config.

I don't have access to my Linux boxes right now, so I can't check the specifics, but if I interpreted your needs correctly, and you can't figure it out even with my incredibly vague help, just ask and I'll get the specific entries from home.
Back to top
View user's profile Send private message
satimis
Guru
Guru


Joined: 21 Oct 2003
Posts: 365

PostPosted: Wed Nov 12, 2003 3:19 am    Post subject: Reply with quote

kwiqsilver wrote:
I get the idea you're trying to ssh from gentoo to redhat, then have the redhat box run konqueror and display it on your gentoo box, correct?
On the redhat box, there's a file /etc/ssh/sshd.config (or something like that) that has a few lines about X forwarding. They're probably commented out or set to "Off", turn them on and restart sshd.
If your gentoo box was able to display remotely through X already, you shouldn't need to change anything, but if you do, the file is something like /etc/ssh/ssh.config.

I don't have access to my Linux boxes right now, so I can't check the specifics, but if I interpreted your needs correctly, and you can't figure it out even with my incredibly vague help, just ask and I'll get the specific entries from home.

Hi,

Thanks for your response.

I explain what I was trying to do in this few days.

I need machineA to connect/navigate machineB via SSH doing administration work, including remote-retrieving documents from machineB displaying the same on machineA. All works are done solely on machineA. In the same way machineB can do the same job when it is not navigated by machineA.

machineA=RH9
machineB=Gentoo.

Now machineA can navigate machineB but the other way round is only by luck. Sometimes it works another time if doesn't.

On /etc/ssh/sshd_config of both machines, following lines already exists

ForwardX11=yes
ForwardAgent=yes

B.R.
satimis
Back to top
View user's profile Send private message
satimis
Guru
Guru


Joined: 21 Oct 2003
Posts: 365

PostPosted: Wed Nov 12, 2003 3:42 am    Post subject: Reply with quote

SZwarts wrote:
I'm not quite sure what your question is. I see a lot of logs with things you try but I do see no question in your entire post.
So if my answers don't cover your question, please ask the question.

Quote:

As USER ***

$ ssh -X satimis@192.168.0.1
satimis@192.168.0.1's password:
-bash-2.05b$ konqueror
konqueror: cannot connect to X server


I don't have a real idea from what you are doing here. If you type -X from a console, the remote PC tries to connect to the same DISPLAY as your previous shell, which might be empty.
So try echo $DISPLAY and before you ssh to see if it has anything
or do a
Code:

DISPLAY=192.168.0.2:0ssh -x <name>@<otherpc>

if you the computer you're trying from is 192.168.0.2 and has X running on 0...

Quote:

As ROOT ***

# xhost + 192.168.0.1
xhost: unable to open display ""

You probably su'ed from a normal user without copying the DISPLAY setting. So either you reverse the process first xhost +192.168.0.1 and then su or
Code:

su
Password:
DISPLAY=192.168.0.2:0 xhost +192.168.0.1

here root allows 192.168.0.1 to connect to the user session of 192.168.0.2:0

Hope this solves some of the mysteries you have, otherwise, you'd probably better of asking what you want, instead of only putting what you do.

Hi,

Thanks for your advice.

Sorry not having explained clear on my first posting of what I have been trying to do in the last few days.

I need machineA to connect/navigate machineB via SSH doing administration work, including remote-retrieving documents from machineB displaying the same on machineA. All works are done solely on machineA. In the same way machineB can do the same job when it is not navigated by machineA.

machineA=RH9 (192.168.0.1)
machineB=Gentoo (192.168.0.2)

Now machineA can navigate machineB with a simple SSH command as follow;

# ssh -X user(or root)@192.168.0.2

It works both as root and user.

But the other way round is only by luck. Sometimes it works another time it doesn't.

On /etc/ssh/sshd_config of both machines, following lines already exists

ForwardX11=yes
ForwardAgent=yes

I have tried your suggestion before. It worked on machineA ONLY. But in fact machineA can connect machineB with the simple ssh command as abovementioned. I can do nothing on machineB (Gentoo). It depends on luck. I have been trying for 3 days without a solution including upgrading OpenSSH packages on RH9 box. The Gentoo 1.4 box is a newly installed machine. I doubt whether there is something wrong on machineB. I will take out a RH8.0 box replacing machineB (Gentoo box) later to confirm my doubt.

B.R.
satimis
Back to top
View user's profile Send private message
kwiqsilver
Guru
Guru


Joined: 19 Mar 2003
Posts: 360

PostPosted: Wed Nov 12, 2003 6:03 am    Post subject: Reply with quote

What about this line in ssh_config on the client box?
ForwardX11 yes

That's the one I usually forget.
Back to top
View user's profile Send private message
satimis
Guru
Guru


Joined: 21 Oct 2003
Posts: 365

PostPosted: Wed Nov 12, 2003 8:44 am    Post subject: Reply with quote

kwiqsilver wrote:
What about this line in ssh_config on the client box?
ForwardX11 yes

That's the one I usually forget.

Hi,

PART 1
I have made following tests before receiving your advice.

Connecting machineA to another RH8.0 box (machineC)

machineC (RH8.0 box)
NIC
IP 192.168.0.2
Mask 255.255.255.0
Gateway 192.168.0.1

/etc/ssh/ssh_config
Host *
ForwardX11 yes

/ect/ssh/sshd_config
X11Forwarding yes
Subsystem sftp /usr/libexec/openssh/sftp-server

(all are default. I have not editted these files - ssh_config and sshd_config)

Test-1
On machineA - RH9.0
/etc/init.d/iptables stop
leaving only Shorewall running
(remark: I am testing Shorewall on this machine)
also on machineC (RH8.0 box) /etc/init.d/ipchains stop

$ xhost +
access control disabled, clients can connect from any host
$ ssh -X satimis@192.168.0.2
ssh: connect to host 192.168.0.2 port 22: Connection refused

Test-2
On machineC (RH8.0)
# ssh -X satimis@192.168.0.1
ssh: connect to host 192.168.0.2 port 22: No route to host

Neither can machinC ping 192.168.0.1


PART 2
machineB (Gentoo box) (I suppose you meant client)
/etc/ssh/ssh_config
Host *
ForwardX11 yes

already there


I am trying hard to find out where the problem comes from, machineA (RH9 box) or machineB (Gentoo box) or machineC (RH8.0)

Any suggustion?

B.R.
satimis
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum