LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-25-2012, 07:25 PM   #1
ssiddall
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Rep: Reputation: Disabled
SSH connection problem


Computer 1: Running VMWare on Windows XP gets SSH and telnet connections to Linux target @ 192.168.0.2 using DLINK adapter with IP 192.168.0.3.

Computer 2: Running same version of VMWare on Windows 7 can't get SSH or telnet connection to the SAME Linux target (192.168.0.2) using the SAME DLINK adapter. ("ssh: connect to host 192.168.0.2 port 22: Connection refused") I think I attempted to initially make a connection with the DLINK adapter address of 192.168.0.4.
=================
mmes@ubuntu:~/.ssh[/email]$ ssh -vvv 192.168.0.2
OpenSSH_5.3p1 Debian-3ubuntu3, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.2 [192.168.0.2] port 22.
debug1: connect to address 192.168.0.2 port 22: Connection refused
ssh: connect to host 192.168.0.2 port 22: Connection refused
==================
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 192.168.0.130:48340 10.30.173.2:445 ESTABLISHED -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
==================
mmes@ubuntu:~/.ssh$ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
====================
Both computer 1 and 2 are on the same network. I have (I think) opened port 22 on the Windows 7 machine. I initially tried connecting to the Linux target from computer 1 using IP 192.168.0.4.

Its either a Windows 7 problem or a key issue.

Thanks for any help you can provide.

Last edited by ssiddall; 10-25-2012 at 07:37 PM.
 
Old 10-26-2012, 02:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
This doesn't make sense... you're talking about connecting from an XP / Win7 machine yet there's ubuntu output? What's that all about? What virtualization is being done ?
 
Old 10-26-2012, 05:57 AM   #3
ssiddall
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
No, I'm not trying to connect a XP machine to a Windows 7 machine. I'm trying to connect two different computers to a linux target device. I can connect the XP machine to the device, but the Windows 7 machine cannot. Both computers are running VMWare, which is where the Ubuntu output comes from.

Maybe it'll help if I draw a picture:
XP Running VMWare (192.168.0.3) <-> Linux target device (192.168.0.2) (This connection works)
Windows 7 Running VMWare (192.168.0.3) <-> Linux target device (192.168.0.2) (This connection does not)

I'm not trying to do this at the same time.
 
Old 10-26-2012, 06:15 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
nope lost. Why do you keep mentioning VMWare and windows and not Ubuntu? if it's a windows issue, treat it as one. can you use putty from Win7 to reach that box or not? It'll certainly be nothing related to SSH Keys as that's not relevant until after you've got a tcp connection.
 
Old 10-26-2012, 06:50 AM   #5
ssiddall
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
VMWare is a virtual machine that runs Ubuntu Linux within the Windows environment.

I have to do my development work in a Linux environment, hence VMWare. I don't *know* if it's a Windows issue or something else. I can't get a putty connection from Windows 7 OR within VMWare. THAT IS MY PROBLEM!
 
Old 10-26-2012, 07:02 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
right so if you can't get it from Win7, anything past that is clearly irrelevant. so can you ping the box? do you get an arp entry for it? You say above that bot Win7 and XP are on 192.168.0.3? Typo? Dual boot?
 
Old 10-26-2012, 07:53 AM   #7
ssiddall
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I was using the XP machine first using a USB to Ethernet DLINK adapter to connect to the Linux target. Worked fine. I disconnect the same USB to Ethernet adapter from the XP machine and connect it to the Windows 7 machine and use the same address (192.168.0.3) to *try* to connect to the Linux target (192.168.0.2). I can ping the Linux target device from the Windows 7 computer.

Output from VMWare on Windows 7 machine:
mmes@ubuntu:~$ arp -v
Address HWtype HWaddress Flags Mask Iface
192.168.0.2 ether 00:50:56:f5:f6:29 C eth4
Entries: 1 Skipped: 0 Found: 1

Output from the Linux target:
/$ arp -v
? (192.168.0.3) at 00:80:c8:3c:9c:21 [ether] on usbDLink0
 
Old 10-26-2012, 12:08 PM   #8
hua
Member
 
Registered: Oct 2006
Location: Slovak Republic
Distribution: Slackware 14.2, current
Posts: 464

Rep: Reputation: 79
Quote:
Originally Posted by ssiddall View Post
Running same version of VMWare on Windows 7 can't get SSH or telnet connection to the SAME Linux target (192.168.0.2) using the SAME DLINK adapter. ("ssh: connect to host 192.168.0.2 port 22: Connection refused")
To make sure that you connect to the correct IP, lets check whether the actual attempt reaches the Linux host. There are several methods how to do this and its up to you which one fits for you. I would suggest you to use this first:
1. Method
Code:
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j LOG --log-level 4
This will log the attempt of connection to port 22 (whether there is sshd listening or not). You should see something like this in your logs (/var/log/messages, or in syslog, iptables.log - try to find it!).
Code:
Oct 26 18:46:29 user kernel: [ 2665.605756] IN=wlan0 OUT= MAC=-- SRC=192.168.0.x DST=192.168.0.x LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=28766 DF PROTO=TCP SPT=41326 DPT=22 WINDOW=14600 RES=0x00 SYN URGP=0
If you cannot find this it means that the attempt didn't reached the Linux host.

2. Method
You can run tcpdump to see the network traffic on Linux host while trying to connect to the port 22. Command:
Code:
tcpdump
Output:
Code:
18:55:35.361290 IP ssh.client .41329 > linux.host.ssh: Flags [S], seq 229172, win 14600, options [mss 1460,sackOK,TS val 1286167349 ecr 0,nop,wscale 4], length 0
18:55:35.361387 IP linux.host.ssh > ssh.client.41329: Flags [S.], seq 2628391990, ack 229173, win 4344, options [mss 1460,sackOK,TS val 2915244 ecr 1286167349,nop,wscale 7], length 0
Please post from where (what PC) you are connecting to the Linux host while you are trying the previous steps (for example - Win7). Also what software are you using (for example - putty).
Test it and we can proceed to next step.

Last edited by hua; 10-26-2012 at 12:13 PM.
 
Old 10-30-2012, 07:04 AM   #9
ssiddall
LQ Newbie
 
Registered: Oct 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I ran putty and it did some key generation stuff and I can now connect via ssh using TeraTerm. I still can't connect from a VMWare terminal using "ssh root@192.168.0.2" from the Windows 7 machine like I can from the XP machine.

Thanks for the info hua.
 
  


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
ssh connection problem. windstory Linux - Newbie 2 01-02-2009 06:25 PM
Problem setting up ssh connection lazylogic Debian 7 10-02-2008 05:13 PM
A problem with ssh connection lawrence_lee_lee Linux - Software 5 05-16-2008 08:14 AM
Ssh connection Problem ??? ce_emre Linux - Networking 2 10-11-2006 07:22 AM
ssh connection problem klemen Linux - Networking 2 06-19-2005 04:01 AM

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

All times are GMT -5. The time now is 10:17 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