You are not logged in.

#1 2010-07-31 13:19:37

K-radical
Member
Registered: 2009-10-05
Posts: 32

ssh: connect to host <ipaddress> port 22: Connection refused

I'm experiencing something very weird and I honestly don't know what to make of it.  So I've got two machines; 'server' and 'workstation'.  Server is running sshd configured (to the best of my knowledge anyways...) properly.  Every time I reboot the server itself or restart /etc/rc.d/sshd, I am unable to ssh to it from workstation. 

Workstation reports the error in the title of this thread.

This happens every single time, so all I have to do to fix it is ping workstation from server.  After that it can ssh to it no problem.  Why is this?  How can I resolve this so the initial ping is not needed?

Thanks,

Offline

#2 2010-07-31 15:44:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: ssh: connect to host <ipaddress> port 22: Connection refused

Two questions:
1. In the failed condition, can you ping the server from the workstation?
2. What is the architecture of the network ? ( Wireless?, Router? Cross over cable?)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2010-07-31 16:15:42

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,730
Website

Re: ssh: connect to host <ipaddress> port 22: Connection refused

I'm assuming that the server part is OK, based on your explanation of the problem;however, you should also add in the server in /etc/hosts.allow the following:
(this assumes that you want to give access to your client machine with an address of  192.0.168.1.23)
sshd:192.0.168.1.23

Notice that this grants access to the machine with the specific address.
You could make the server open to anyone by using:
sshd:ALL

but that is not advisable.

Hope this helps.

Ricardo

Offline

#4 2010-07-31 17:05:04

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,690

Re: ssh: connect to host <ipaddress> port 22: Connection refused

I agree with almost everything ralvez said, and all of that should be necessary.  The fact that you can, eventually, establish a ssd session tells me that may already be in place. 

My concern is whether the network knows how to discover the route from the workstation to the server without first getting a clue from the server side my initiating a transaction first.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2010-07-31 17:09:37

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,730
Website

Re: ssh: connect to host <ipaddress> port 22: Connection refused

ewaller wrote:

I agree with almost everything ralvez said, and all of that should be necessary.  The fact that you can, eventually, establish a ssd session tells me that may already be in place. 

My concern is whether the network knows how to discover the route from the workstation to the server without first getting a clue from the server side my initiating a transaction first.

I think you have made a very good point here ... and it made me think wink
I wounder if K-radical has setup his /etc/hosts in his workstation.

R.

Last edited by ralvez (2010-07-31 17:09:58)

Offline

#6 2010-07-31 21:53:04

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: ssh: connect to host <ipaddress> port 22: Connection refused

You can always use the -v switch for verbosity when trying to ssh to your server. 'Connection refused' can mean a lot of things, from sshd not running on that port, to not being active on the server at all, or to refusing a connection because it only accepts keys instead of passwords, ...

It's a bit like saying 'hey, my computer doesn't work!' wink


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB