LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-03-2005, 12:59 AM   #1
eminence
LQ Newbie
 
Registered: May 2005
Location: Idaho, United States
Distribution: Ubuntu
Posts: 15

Rep: Reputation: 0
Arrow 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
 
Old 07-03-2005, 01:10 AM   #2
roopunix
Member
 
Registered: Feb 2004
Location: Kathmandu
Distribution: Redhat/fedora/Suse [Wanna Drive With Debian]
Posts: 208

Rep: Reputation: 30
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
 
Old 07-03-2005, 02:57 AM   #3
vimal
Red Hat India
 
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
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
 
Old 07-03-2005, 05:49 AM   #4
Ipolit
Member
 
Registered: Nov 2003
Location: Bulgaria
Distribution: Vector Linux, Morphix
Posts: 293

Rep: Reputation: 31
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
 
Old 07-03-2005, 06:18 AM   #5
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
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 ~]$
 
Old 07-03-2005, 07:16 AM   #6
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
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
 
Old 07-03-2005, 02:30 PM   #7
eminence
LQ Newbie
 
Registered: May 2005
Location: Idaho, United States
Distribution: Ubuntu
Posts: 15

Original Poster
Rep: Reputation: 0
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.
 
Old 07-04-2005, 05:58 AM   #8
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
Good to hear you are up and running!

MrKnisely
 
Old 10-02-2009, 05:38 PM   #9
rforth
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by charon79m View Post
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!
 
Old 07-09-2011, 04:00 AM   #10
aneeshtan
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
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
 
Old 07-09-2011, 04:25 AM   #11
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
Quote:
Originally Posted by aneeshtan View Post
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.
 
Old 07-09-2011, 04:52 AM   #12
aneeshtan
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
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 ?!

Last edited by aneeshtan; 07-09-2011 at 04:55 AM.
 
Old 07-09-2011, 04:58 AM   #13
aneeshtan
LQ Newbie
 
Registered: Jun 2011
Posts: 4

Rep: Reputation: Disabled
This issue solved :

setting ssh enabled on both sides

setting the permission of files to 777 or 666

and all done
 
Old 08-18-2011, 02:54 PM   #14
NeoSpace
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
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"
 
Old 03-06-2012, 12:22 AM   #15
monikadwadasi
LQ Newbie
 
Registered: Mar 2012
Posts: 1

Rep: Reputation: Disabled
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
 
  


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
SSH Connection Refused? lowpro2k3 Linux - Networking 2 11-04-2009 11:02 AM
ssh in fedora: connection refused zwanzig Linux - Networking 8 06-11-2004 04:26 AM
ssh secure connection refused lugoteehalt Linux - Networking 2 03-19-2004 10:33 AM
ssh connection refused rguptatx Red Hat 4 11-13-2003 06:18 PM
SSH port...Connection....refused?? Miyamoto Mandriva 6 08-26-2003 04:03 PM


All times are GMT -5. The time now is 07:31 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