LinuxQuestions.org
Help answer threads with 0 replies.
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-27-2011, 09:12 PM   #1
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181
Blog Entries: 3

Rep: Reputation: 16
SSH connection refused on local network


After looking online and searching the forums, I only find vague suggestions that haven't helped with this problem:

I have Fedora 16 on VMWare player, in Windows 7 and when trying to ssh to a Linux 15 server on the local network, I get "connection refused."

I have:
--verified ssh is installed and running on both machines
--verified that "ssh localhost" works on both machines
--tried disabling Windows Firewall, no effect
--tried adding port 22 to the router configuration to allow traffic, no effect
--telnet also fails

I see that using ssh -vv flag tells me nothing new, other than connection refused and the IP (my router's internet-facing IP, interestingly enough).

Any suggestions on what else to try?
 
Old 11-27-2011, 09:41 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Hi mbvpixies78, You say you "tried adding port 22 to the router configuration to allow traffic". Did you forward the port to the internal IP of the machine you're trying to connect to?

Good luck. ;-)

Last edited by Peacedog; 11-27-2011 at 09:43 PM.
 
Old 11-27-2011, 09:56 PM   #3
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Yes, I have a Linksys router and have "port range forward" for port 22 to the private IP of the linux server to which I'm trying to ssh, applying to both TCP and UDP protocols ("Both".) (At least on the page I looked at, the network portion of the IP is non-negotiable, meaning I couldn't set it to the internet-facing IP even if I wanted to do so.)

I really can't think of anything else to try here. I understand networking much better than I used to (halfway through CCNA) and still, no luck with something so simple.

I was thinking, once the semester is over, about replacing the router's firmware with OpenWRT, but I don't think that would necessarily make any difference. My hunch is that this is some screwy Windows bug. I want to wipe the laptop and use Linux instead of Linux VM on Windows... will be interesting to see if problem goes away, but I can't do that for another month. Meanwhile, I'd really like to get ssh working sooner than that.

Last edited by mbvpixies78; 11-27-2011 at 09:58 PM.
 
Old 11-27-2011, 10:01 PM   #4
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
keeping traffic "in the family"

Quote:
Originally Posted by mbvpixies78 View Post
...ssh to a Linux 15 server on the local network, I get "connection refused."
...my router's internet-facing IP, interestingly enough
If your external IP is denying entry, some aspect of your connection attempt is sending your traffic outside the router and then back in. If you're connecting LAN to LAN, you shouldn't need to even touch your router (looks like you already know that, but I just wanted to make sure).

I haven't used VMWare in awhile, but something about virtualizing a NIC creates networking complex enough to require minds greater than mine to fully grasp. I remember deciding (read: trial and many errors) between giving the VM its own address and using the host machine's IP with NAT. I can't recall now which worked better; try switching from wherever you are now.

Sorry I can't offer more specifics, but take care to ensure your traffic stays in-house. Is DNS taking you outside?
 
Old 11-27-2011, 10:10 PM   #5
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Sorry, I overlapped you. One more idea: The gateway! If your VM is using your host OS as a gateway (which in turn uses the router), the only way your traffic can go anywhere is through the router first.

Quote:
Originally Posted by mbvpixies78 View Post
My hunch is that this is some screwy Windows bug.
Also possible^H^H^H probable. I'm always eager to blame Windows. Though we sound like cynix, always bet on Linix.
I made that up just now. Feel free to use it GPL.
:-)

Other random thoughts:
Unless you can't specify TCP/UDP on your router, ssh will never use UDP.

Good job on that CCNA--I need to get back to mine. That TCP stack is incredible the first time you peel it apart. Rusty now, but I got pretty good at calculating netmasks. My friend said I was odd for enjoying that part, and he's probably right.

Last edited by zedmelon; 11-27-2011 at 10:14 PM. Reason: clarification ...I hope
 
Old 11-28-2011, 09:33 PM   #6
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Any NDIS filters on the host, McAfee, Symantec?

Good luck. ;-)
 
Old 11-29-2011, 05:09 PM   #7
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
I'm using NAT and I will look into changing that since I've never done so before. I'll post results when I have the time to try this.

I'll have to look into NDIS before I can respond.

Thanks!
 
Old 11-30-2011, 11:36 PM   #8
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
bridged, still not working

I switched VM from NAT to bridged and now instead of "Connection refused," I get "Connection timed out."

With ssh -vv user@dom.ain I see that it's still trying to connect to the internet-facing interface IP.

If I try ssh user@<privateIPaddress> I get the same "Connection timed out."
 
Old 12-02-2011, 12:05 AM   #9
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Quote:
Originally Posted by mbvpixies78 View Post
I switched VM from NAT to bridged and now instead of "Connection refused," I get "Connection timed out."
"Refused" is generally a box not running ssh--or at least not accepting clients. The timeout means your auth never reaches its destination--unless it drops unwanted packets with a firewall.

Quote:
Originally Posted by mbvpixies78 View Post
With ssh -vv user@dom.ain I see that it's still trying to connect to the internet-facing interface IP.
Public DNS only knows you by your public IP, so connecting to host.dom.ain will will always route out through the interwebs--and consequently back into your router--unless you're serving internal DNS.

Quote:
Originally Posted by mbvpixies78 View Post
If I try ssh user@<privateIPaddress> I get the same "Connection timed out."
Somehow the routing is broken, and I'm fuzzy on when a virtual bit on a virtual NIC becomes a real bit on a real NIC (see previous reference to networking voodoo in a VM). Does a traceroute show anything useful? Try running nmap from a Linux box to your Windows box running the VM. Does it find ssh running on a nonstandard port?
 
Old 12-08-2011, 01:49 AM   #10
mbvpixies78
Member
 
Registered: Nov 2007
Location: Vietnam
Distribution: CentOS
Posts: 181

Original Poster
Blog Entries: 3

Rep: Reputation: 16
wtf...

I replied to this post once I fixed the problem but apparently the post disappeared into the ether fuzz.

Essentially, I switched from NAT to a bridged connection, if I recall correctly, and then I made sure to add exceptions to my Windows Firewall for both outgoing and incoming communications over ssh port 22. That fixed it. Now I have a new ssh question pertaining to encrypted system log-in that I'll post elsewhere.

Thanks for your help!
 
Old 12-08-2011, 12:21 PM   #11
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Quote:
Originally Posted by mbvpixies78 View Post
I switched from NAT to a bridged connection...exceptions to my Windows Firewall for both outgoing and incoming communications over ssh port 22. That fixed it.
Excellent! Glad to hear it. I was wondering.

...dang either fuzz.
;-)
 
  


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
Shorewall + Squid + 111 connection refused on local network prixone Linux - Server 1 11-30-2007 10:15 AM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
SSH connection refused bmccorm2 Linux - Networking 4 05-15-2007 02:59 PM
ssh connection refused rguptatx Red Hat 4 11-13-2003 06:18 PM
vsftpd - local connection refused simonmccourt Linux - Networking 15 11-02-2003 03:35 PM

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

All times are GMT -5. The time now is 03:11 PM.

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