Reputation: 105
Normally, when I transfer a dumped database from postgres CLI in my local machine, I can simply sftp my_user_name@my_ip
remotely from postgres CLI to my local machine without any problems. However, when it comes to my remote server, this seems like I have already connected with my server via ssh connection; thus, when I sudo su - postgres
to open up postgres CLI, I cannot use the same technique to
i)sftp my_user_name@my_ip
. It said request Connection timed out
; I think this may be because they are not in the same WiFI network connection.
ii) or even sftp [email protected]
. It said my aws ec2 server: Permission denied (public key)
I think this may result from I have made a SSH connection already, so if i sftp again, this will duplicate with the previous SSH connection.
Any idea ?? Please help
Upvotes: 1
Views: 79
Reputation: 10876
it should be simple. I will help you here. Firstly are both machines on same network ? your first comment looks like they are not on same network or we can say they are not connected to each other hence connection timed out. on your second comment; u would need to use pem file to connect to ec2.. Please give all details ; and I will give you commands etc. needed. Also, check security group of destination server if port 22 is open.
Upvotes: 1