LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH - Connection Refused (https://www.linuxquestions.org/questions/linux-networking-3/ssh-connection-refused-339510/)

eminence 07-03-2005 12:59 AM

SSH - Connection Refused
 
I'm new to the whole SSH thing, and I can't get it to work. I've googled left and right, but haven't found any answers.

I am trying to get SSH to work just between two Ubuntu desktops on a local LAN. sshd is running, and I use firestarter and have port 22 open to SSH, and everything else (like pinging) between the two computers works. But when I try:

ssh 192.168.1.101

or any variation thereof, I get the message:

ssh: connect to host 192.168.1.101 port 22: Connection refused

and exactly the same when I try from the other computer to this one. Any help would be appreciated.

-eminence

roopunix 07-03-2005 01:10 AM

i had faced the same problem on redhat9. May be it can help you. the cause was due to keys.

#cd /root/.ssh
#vi known_hosts
*delete everyting on that file
#service sshd restart

this should work

vimal 07-03-2005 02:57 AM

the main reason may be that the public keys generated by the server has changed for some reason in the client. this may happen when u have reinstalled the ssh server.this changes the ssh public keys and shows a mismatch in the client. for that remove the file ".known_hosts" in "~/.ssh/" where ~ is the home directory of the user by which u r trying to login. now retryin ssh to the server. this may show a message that a new key has been recieved. type yes . this brings the ssh session into existence. if this worked for u click on the thanks button. bye happy sshing ...
vimal

Ipolit 07-03-2005 05:49 AM

u have to make shore that sshd is running on the remote computer.
and the command u type is correct if u have the user with the same name as the user on your computer.
if we assume that I have a user called ipolit on the remote machine the command is
ssh ipolit@192.168.1.101

scowles 07-03-2005 06:18 AM

ssh: connect to host 192.168.1.101 port 22: Connection refused

The above error looks more like sshd is not running on host 192.168.0.101. Another possibility is your firewall rules are blocking ssh connections.

FWIW: I can re-create this error by simply trying to ssh to my XP box:
Code:

[scowles@excelsior ~]$ ping -c1 192.168.9.21
PING 192.168.9.21 (192.168.9.21) 56(84) bytes of data.
64 bytes from 192.168.9.21: icmp_seq=0 ttl=127 time=0.967 ms
...snip

[scowles@excelsior ~]$ ssh 192.168.9.21
ssh: connect to host 192.168.9.21 port 22: Connection refused
[scowles@excelsior ~]$


charon79m 07-03-2005 07:16 AM

Probably do not have sshd
 
Fire up your synaptic package manager and do a search for openssh-server.

Make sure that it is installed.

Next, make sure you do not have a firewall enabled to block SSH.

If you have the ssh server installed, you might want to use netstat to ensure the it is listening on port 22.

I've got a few Ubuntu boxes, and as I remember it the server was not installed by default.

MrKnisely

eminence 07-03-2005 02:30 PM

Thanks charon79m, that was the problem. start-stop-daemon reported sshd to be running, but the server package wasn't installed.

And thanks everyone else for the quick responses.

charon79m 07-04-2005 05:58 AM

Good to hear you are up and running!

MrKnisely

rforth 10-02-2009 05:38 PM

Quote:

Originally Posted by charon79m (Post 1727365)
Fire up your synaptic package manager and do a search for openssh-server.

Make sure that it is installed.

Next, make sure you do not have a firewall enabled to block SSH.

If you have the ssh server installed, you might want to use netstat to ensure the it is listening on port 22.

I've got a few Ubuntu boxes, and as I remember it the server was not installed by default.

MrKnisely

Thanks for a great answer this helped me no end I managed to install using sudo apt-get install openssh-server.

Thank You!

aneeshtan 07-09-2011 04:00 AM

hey guys

I have the same problem , and when I enter the following command line everything is ok

Code:

ssh 100.248.140.44
problem is in doing scp and copying files to other server


Code:

scp -r admin@100.72.232.207:/_backup_/ admin@100.248.140.44:/_backup_/
and it returns this error:

Code:

ssh: connect to host 100.248.140.44 port 22: Connection refused
lost connection
Connection to 100.72.232.207 closed.


I searched a lot and it got me headache ,but still i couldn't find a soloution .

please answer in codes so i can try them

the guy that says he found his solution didn't mention how to install server package ssh


I'm using centos 5.5

thanks

Reuti 07-09-2011 04:25 AM

Quote:

Originally Posted by aneeshtan (Post 4409596)
Code:

scp -r admin@100.72.232.207:/_backup_/ admin@100.248.140.44:/_backup_/

You can also login to 100.248.140.44 from 100.72.232.207 without entering a password or passphrase? Specifying two remote destinations needs ssh-key authentication (maybe with agent forwarding), as otherwise you would have to reveal your password or passphrase to one of the remote servers. It’s a safety measure.

aneeshtan 07-09-2011 04:52 AM

hmm

I change both sides' ports to 22 and it worked and its now asking for second password

but after hitting the password of target server it returns another error :


Code:

# scp -r admin@100.72.232.207:/_backup_/ admin@100.248.140.44:/_backup_/
admin@100.72.232.207's password:
admin@100.248.140.44's password:

scp: /_backup_//_backup_: Permission denied

what should i set the permission of these folders on both servers


this ssh commands and limitations sucks

any other comments on the above error ?!

aneeshtan 07-09-2011 04:58 AM

This issue solved :

setting ssh enabled on both sides

setting the permission of files to 777 or 666

and all done

NeoSpace 08-18-2011 02:54 PM

I had the same problem a while ago, make sure that outgoing ssh port 22 is not being blocked, you can try the online test at http://ssh.icannotconnect.com/ it should say "Allowed"

monikadwadasi 03-06-2012 12:22 AM

connection refused [error11n]
 
while i am trying to allow access port to my instance the follow error is occurred.

Can any one help me out..

euca$ euca-authorize default -P tcp -p 22 -s 0.0.0.0/0
[Errno 111] Connection refused


All times are GMT -5. The time now is 01:00 PM.