LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 08-17-2003, 01:41 AM   #1
Skurge
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Rep: Reputation: 0
ssh: remote connections refused


I've been looking around all day and finally broke down and figured I'd have to ask a question of my own instead of leaching off the questions of others for info.

I just got a fresh install of RH9 on a p3 550 going and I can connect to the machine via my windows box with the local IP (192.168.1.100) but not the internet IP (for me to know)

I've setup a linux box the same way before except it had GUI and an XP install dual booted with it. SSH worked fine out of the box.

Things I've already done:

+Put 192.168.1.100 in the DMZ with my router. All routing is static, no DHCP used. I also tried forwarding port 22.
+Put security setting to no firewall during the install.
+Tried SSH from a computer outside of the region.
+nmapped for port 22, its open.
+Messed around with hosts(allow,deny) according to what others have tried, with no luck.
+Set the IP variable in /etc/ssh/sshd_config to the lan IP, and the inet IP.
+Reinstalled. teehee.
+Probably more that I don't remember, please helpppppp!!!

Uhm, other than that... There is nothing in the /var/log/messages or secure files that have to do with unsuccesful ssh. I guess this tells me that its not even getting through to the box, but it worked exactly the same way on the previous dual boot box I setup.

Someone solve this and make me feel stupid, please.
 
Old 08-17-2003, 07:53 AM   #2
jisse
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: rh/debian
Posts: 43

Rep: Reputation: 15
The things you've done are not completely clear yet:
+Did you try to nmap from the Internet to your machine?
If you are able to see an open port 22 from the Internet, try to ssh from the Internet with a -v option to show some debug information. If you are not, this is most likely a router problem. Put some more information on what kind of Internet connection you have: ADSL Ethernet modem? Cable? What kind of modem?
 
Old 08-17-2003, 03:58 PM   #3
Skurge
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Alright well thank you for making me feel stupid, thats what I needed.

I did a portscan from my windows machine to my IP which should point to my RH box. I got back smtp, http, ftp, and pop3, but no ssh. This means that its not a router problem I hope.

And as for connection information, I have an adsl connection with a static IP. The modem is generic and its also bridged so it doesn't matter. The router is 4 port linksys.
 
Old 08-17-2003, 05:21 PM   #4
jisse
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: rh/debian
Posts: 43

Rep: Reputation: 15
A problem allways can be solved. It just takes some time. There's nothing stupid about that.
+Can you still do a "ssh localhost"?
+What kind IP variable did you try to set in /etc/ssh/sshd_config? It doesn't sound familiar to me.

A remote portscan not showing port 22 means SSH is not listening at all to the outside world. It indeed is not a routing problem cause the portscan works for the other services.

I hope you made sure along the way that ssh was running (ps aux| grep ssh)
 
Old 08-17-2003, 05:29 PM   #5
Skurge
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Yea I can ssh localhost, however my problem just got funkier...

I thought earlier that it might be a problem like not getting any outside internet access at all, so I pinged google and it came back fine. However now (I think it might be new to the reinstall I did) I can't ping anything outside the network...

I just did a port scan with an outside the network machine and it came back with the same as the one I did on this machine (which is inside the network).

So I'm a little lost now.

In sshd_config I meant ListenAddress, not IP

ListenAddress 192.168.1.100
ListenAddress 209.216.188.xxx

Is wat I tried, not at the same time though.
 
Old 08-17-2003, 05:48 PM   #6
jisse
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: rh/debian
Posts: 43

Rep: Reputation: 15
Okay, I don't bother anymore about the SSH settings. First things first. You have a problem with your network.
* Does "ifconfig" show all your network interfaces including lo?
* Can you ping your routers IP?
* Can you ping your other machines?
* Can you ping www.google.com's IP address: 216.239.39.99?
* Are there entries in /etc/resolv.conf?
* Does internetworking still work on the other machines?
* Are all machines wired only to the router, or are they interlinked as well?

* Does your router support NAT? If so, does it still have a NAT rule of forwarding port 22 to your Linux machine?
 
Old 08-17-2003, 06:07 PM   #7
Skurge
LQ Newbie
 
Registered: Aug 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I had some entries in resolve.conf, going off others suggestions. I added 209.216.188.xxx (my IP) and my ISPs nameservers 209.216.160.2, 209.216.160.131. I removed my IP and restarted, nothing. I have now removed the nameservers, haven't restarted yet.

Google doesn't work:
ping 216.239.39.99
connect: Network is unreachable

Pinging router works.

I have 2 nics in the machine, 1 isn't plugged in to anything though.

[root@Artemis root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:E0:4C:ED:ED:FF
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:814 errors:0 dropped:0 overruns:0 frame:0
TX packets:486 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:69532 (67.9 Kb) TX bytes:57236 (55.8 Kb)
Interrupt:10 Base address:0x7000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12509 (12.2 Kb) TX bytes:12509 (12.2 Kb)

I can ping other machines in the network fine.

All machines are plugged into the router and work with each other through that.

Router doesn't support NAT.

Last edited by Skurge; 08-17-2003 at 06:11 PM.
 
Old 08-18-2003, 01:06 PM   #8
jisse
Member
 
Registered: Jul 2003
Location: netherlands
Distribution: rh/debian
Posts: 43

Rep: Reputation: 15
If you can ping from the other machines an address on the Internet (for instance Google), it may be just a routing problem on your Linux machine. If you want to access from your machine both your internal network and the Internet, you need to have a default gateway set to the router.
Check with "netstat -rn" your routing table. If it doesn't mention your router's IP address as gateway, that's the problem.
Add the router like this:
# route add default gw 10.0.0.138
Then try to ping the IP address of Google again. If it works, you want to set your router as gateway permanently. Add in /etc/sysconfig/network an entry like "GATEWAY=192.168.1.1" if 192.168.1.1 is your routers IP.
 
Old 08-18-2003, 01:28 PM   #9
gbg
Member
 
Registered: Aug 2003
Location: Lisbon Portugal
Distribution: Red Hat 9
Posts: 55

Rep: Reputation: 15
just do this /etc/rc.d/rc3.d/S55sshd status

if is not running start it - /etc/rc.d/rc3.d/S55sshd start

or if you did install redhat-config-services run it and start the service.

God Luck.
 
  


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
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 34 05-24-2013 10:28 AM
ssh and nfs connections refused by Linux host running RedHat 9.0 and having 2 NIC erinduffy Linux - Networking 1 01-21-2005 12:13 PM
X and remote connections? jonsson Linux - Newbie 6 11-15-2004 01:25 AM
Remote telnet gets 'Connection refused' ashusharma Linux - Networking 5 01-27-2004 02:12 AM
SSH - Refused Connections bfloeagle Linux - Networking 6 08-31-2001 01:16 AM


All times are GMT -5. The time now is 06:28 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration