Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-19-2005, 08:49 AM   #1
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Rep: Reputation: 31
scp: port 22: No route to host


I started a ssh connection between my computer and a server. Everything works fine. Then I tried the comman scp to copy a file from the server to my computer, and got the following message:
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [] port 22.
debug1: connect to address port 22: No route to host
ssh: connect to host port 22: No route to host

Any suggestion? Thanks a lot.
Old 09-19-2005, 09:15 AM   #2
Red Hat India
Registered: Nov 2004
Location: Kerala/Pune,india
Distribution: RedHat, Fedora
Posts: 260

Rep: Reputation: 34
Hi there,
There are some options :
1) check out if there ia firewall in between. also first ping your own machine, your gateway, a machine outside your network and then a remote server. you can understand where the problem lies by this. perhaps a configuration in between is preventing your connection.
2) also please check your "/etc/ssh/ssh_config" file which is the client's file for ssh configuration. I think the problem is the configuration in "/etc/ssh/ssh_config". here just comment any lines with just the " Host " line. this should make it work most probably. if problems persists please post the errors again....
Old 09-19-2005, 01:40 PM   #3
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 522

Original Poster
Rep: Reputation: 31
the thing is that ssh works. I can connect to the server without any problem. I get problem as soon as I use scp although it uses port 22 too.
Old 12-09-2009, 10:24 AM   #4
LQ Newbie
Registered: Dec 2009
Posts: 1

Rep: Reputation: 0
check your resolv.conf people!

I've had he same issue trying to scp files and folders from one linux machine over to another one on the same network.
Machine A had an externally accessible IP and machine B had a local network IP. so Machine A couldn't find the route to host B because it went searcing through my external gateway while machine A was using the internal gateway.

so, i gave machine A a fixed external IP as well and added my external gateway to the /etc/Resolv.conf. done! i can now scp/ssh with no problem.

Good luck everyone!

Last edited by vrnd; 12-09-2009 at 10:25 AM.
Old 10-22-2013, 09:58 PM   #5
LQ Newbie
Registered: Oct 2013
Posts: 1

Rep: Reputation: Disabled
Exclamation Newbie response

I was stuck on this also. If in a non prod / lab environment, you can try the command "service iptables stop" and then try again. If scp or ssh works, the issue would seem to be in the iptables.


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
route locally generated traffic to ip:port to localhost:port maenho Linux - Software 2 03-11-2005 04:08 AM
no route to host nerdboi Linux - Networking 9 02-08-2005 06:40 AM
no route to host PenguinHead Linux - Networking 9 02-02-2005 02:03 PM
Port 25: No route to host dhruv Linux - Networking 4 04-07-2004 08:23 AM
Port 25: No route to host dhruv Linux - Newbie 0 04-03-2004 09:37 AM

All times are GMT -5. The time now is 04:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration