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 having trouble copying several very large sql dumps via SSH

I used this command:

/usr/bin/scp -P 2382 /ec2/path/file.sql root@$123.45.67.890:/remote/file/path/

And also

/usr/bin/scp -P 2382 -i My2KeyPair.pem /ec2/path/file.sql root@$123.45.67.890:/remote/file/path/

Every time I get this:

ssh: connect to host xx.xx.xx.xxx port 22: Connection timed out lost connection

Removing the -i port switch didn't help.

Source server is an EC2 instance (Amazon Standard linux AMI)
Destination is a dedicated server (CentOS 6.4 minimal)

I googled a lot, one suggestion that came up is to open port 2382 by editing this file: /etc/sysconfig/iptables

I entered this code that I borrowed from iptables.old:

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2382 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

and restarted iptables:

`/etc/init.d/iptables restart`

But that didn't help either!

I'm clueless, any suggestion would be more than welcome!

share|improve this question
    
is the iptables configuration running on the source or on the destination server? Is sshd on the destination server running on port 22 or on 2382? –  etagenklo Jun 7 '13 at 16:52
    
@etagenklo: I changed the iptables configuration on the destination server of course, and sshd is running on port 22 (as I said it didn't work on port 22 either) –  TheDude Jun 7 '13 at 17:00
    
can you login from the source to the destination server via ssh? –  etagenklo Jun 7 '13 at 17:02
    
@etagenklo Yes of course (I am right now, using port 22) –  TheDude Jun 7 '13 at 17:03
    
So the destination server is reachable from the EC2 instance via ssh (or only from other places)? I just ask because your error message says it is not. –  etagenklo Jun 7 '13 at 17:04
show 3 more comments

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.