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?

  • 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. – AKor 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

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".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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