LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-15-2011, 04:57 AM   #1
bijaya.kumar
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Rep: Reputation: Disabled
Post ssh: connect to host 10.137.216.170 port 22: Connection refused


Hi All,

I am facing trouble to scp from server to to my local machine where as the vice-vesra is working fine.

The error is like below.
ssh: connect to host xx.xxx.xxx.xxx port 22: Connection refused
lost connection

Please provide your suggesttion.Any help is appriciated.
Thanx in advance
Bijaya.
 
Old 06-15-2011, 05:03 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Welcome to LQ

Firewall?
Is the ssh daemon running?
Is port 22 forwarded on the router to the local machine?
Does your isp block port 22 incoming?
Can you connect on the local machine
Code:
ssh 127.0.0.1
Kind regards

Last edited by repo; 06-15-2011 at 05:09 AM.
 
Old 06-15-2011, 05:07 AM   #3
manyrootsofallevil
Member
 
Registered: Dec 2010
Distribution: Red Hat, Kubuntu
Posts: 130

Rep: Reputation: 14
Quote:
Originally Posted by bijaya.kumar View Post
Hi All,

I am facing trouble to scp from server to to my local machine where as the vice-vesra is working fine.

The error is like below.
ssh: connect to host xx.xxx.xxx.xxx port 22: Connection refused
lost connection

Please provide your suggesttion.Any help is appriciated.
Thanx in advance
Bijaya.
I wrote about this in a post in my blog
Shamless plug

You need to add a rule like this to the iptables configuration of your server:
Code:
iptables -I INPUT -p tcp -m state --state  RELATED,ESTABLISHED -j ACCEPT

Last edited by manyrootsofallevil; 06-15-2011 at 06:21 AM.
 
Old 06-15-2011, 06:25 AM   #4
bijaya.kumar
LQ Newbie
 
Registered: Jun 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi,

Thanx for your reply.

ssh 127.0.0.1 is working.But I dn't know how to chk the following.

1.Is port 22 forwarded on the router to the local machine?

2.Does your isp block port 22 incoming?

Please share the commands.
Thanx in advance
Bijaya Kumar

Quote:
Originally Posted by repo View Post
Welcome to LQ

Firewall?
Is the ssh daemon running?
Is port 22 forwarded on the router to the local machine?
Does your isp block port 22 incoming?
Can you connect on the local machine
Code:
ssh 127.0.0.1
Kind regards
 
Old 06-15-2011, 06:27 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Are you connecting from the outside to the inside, or on the same LAN?

Kind regards
 
Old 02-14-2012, 04:39 PM   #6
rsheikh
LQ Newbie
 
Registered: Jun 2011
Posts: 14

Rep: Reputation: Disabled
Red face

Quote:
iptables -I INPUT -i eth0 -p tcp --sport 22 -m state --state RELATED,ESTABLISHED -j ACCEPT
If only the gods would have been kinder to the likes of us to show how to make the entry... in the iptables...
 
  


Reply



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
Could not connect to host 127.0.0.1 - connection refused adrian2009 Slackware 1 12-07-2010 06:53 AM
ssh: connect to host XXXX port 22: Connection timed out jv2112 Linux - Newbie 3 07-04-2010 04:42 PM
ssh:connect to host restart port 22: Connection refused myubuntu Linux - Software 20 02-22-2010 11:32 PM
ssh: connect to host thyme1 port 22: Connection timed out - solved abstom Linux - Server 1 09-19-2009 05:33 AM
telnet: Unable to connect to remote host: Connection refused stuckz Fedora 6 06-21-2007 02:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration