Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to scp something to my local machine from a remote server. At first, scp complained that there was no route to host through port 22, but then I forwarded that port on my router. Now, I try to use both ssh and scp to connect to my local machine (I run these commands on the remote server), and they don't do anything. I try to run the command and there's no output, as if it is waiting for something, but it never actually connects. I have to kill the command.

Any help?

share|improve this question
1  
Why don't you try initiating the connection from your workstation, pulling the file down from the server? –  EEAA Apr 30 '11 at 4:06
    
I'm writing a shell script to do several things: scp a few directories, mysqldump (remotely) a few databases. I want to run the script with cron on a regular basis on the remote machine, to back up everything to my local machine. –  Sennheiser Apr 30 '11 at 4:15
    
Well, you have either a firewall problem, a routing problem, or both. –  EEAA Apr 30 '11 at 4:18
    
You should do the mysqldump via cron on the remote machine and then 30 minutes later (or whatever), back up your stuff via a cronned script from your local machine. Then you won't have to muck around with firewall rules, routing, etc. –  EEAA Apr 30 '11 at 4:19
add comment

1 Answer

You may need to open the ssh port in the firewall on your local machine.

But since your remote script really works only when your local machine actually runs, you can launch the backup from the cron on your local machine, too.

This way might give better results, especially if "local" means "behind dynamic IP NAT".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.