outgoing ssh fails from only one machine on lan to outside network

2

I have multiple servers in my LAN (which I'll refer to as Box1), and they are all able to make outgoing SSH connections, except one that stopped recently, which I'll refer to as Box2 (actually, I'm not 100% sure it ever worked, but I think I would have run into this before now if it didn't). They are all running Centos 6.3, with openssh on non-standard ports. Box2 is the entry point for the LAN from the outside world, and I am able to successfully ssh to it, so I know the port isn't blocked. Port forwarding works for either the non-standard port or 22, both forward to Box2. Box2 can ssh into Box1, but for every attempt to ssh to the outside world, I get 'connection refused', which makes me think firewall or something?

I'll try to attempt a summary here:

cloud->box2: works

box1->box2: works

box2->box1: works

box2->box2: works

box1->cloud: works

box2(ftp/ping/etc)->cloud: works

box2(ssh)->cloud: "connection refused"

I think I successfully disabled iptables and selinux. What else should I check?

rwilson04

Posted 2014-06-24T01:16:19.500

Reputation: 163

Answers

0

I hate restarting, but it seems to have been the solution in this case. Ruined a 405 day uptime, and now I'll never know what was wrong, but at least it works.

rwilson04

Posted 2014-06-24T01:16:19.500

Reputation: 163

1

Try checking the settings in Box 2. How are you using ssh? Is it like this:

[root@Box2 ~]# ssh -XC root@Cloud

Make sure that the hostname Cloud is properly defined in /etc/hosts or better yet use the ssh command with the IP address of the Cloud.

Batibot323

Posted 2014-06-24T01:16:19.500

Reputation: 13

ssh home, ssh <ip-address>, ssh user@<ip-address>, ssh -XC user@<ip-address>, etc, they all have the same result – rwilson04 – 2014-06-24T16:10:25.340

If you can access the machine named as Cloud, try opening the file ~/.ssh/known_hosts and delete the entry with the corresponding IP of machine 2. – Batibot323 – 2014-06-25T04:16:45.550

yes, even completely cleared known_hosts – rwilson04 – 2014-06-26T20:57:02.873

0

In this case I would try to check the network settings, Check /etc/hosts, as already stated, or /etc/resolv.conf Be sure that you have correct route to host,

traceroute Cloud

On all cases, try to check logs on the Cloud side, tailf /var/log/secure or auth.log

AlexiusFlavius

Posted 2014-06-24T01:16:19.500

Reputation: 21

I'm able to do other types of traffic to stuff outside the network, like ping and ftp, just not ssh. I don't see anything relevant in secure log, and I don't see an auth log. I'm trying to connect using both hostnames and ip addresses, same results – rwilson04 – 2014-06-24T16:07:51.513

Hello, just wanted to mention known_hosts file on the remote machine, but I see you got this advice already. Make sure iptables are down on both sides and that there is no fail2ban or rate-limit of some kind – AlexiusFlavius – 2014-06-25T04:50:19.307

no fail2ban or rate-limit. this applied to all machines outside the lan – rwilson04 – 2014-06-26T20:58:08.080