title: How can I transfer a dumped database in Postgres CLI from my remote server to my remote server or my local machine?
body: <p>Normally, when I transfer a dumped database from postgres CLI in my local machine, I can simply <code>sftp my_user_name@my_ip</code> 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 <code>sudo su - postgres</code> to open up postgres CLI, I cannot use the same technique to </p>
  
  <p>i)<code>sftp my_user_name@my_ip</code>. It said request <code>Connection timed out</code>; I think this may be because they are not in the same WiFI network connection.</p>
  
  <p>ii) or even <code>sftp ubuntu@ec2-xx-xx-xx-xxx.....amazonaws.com</code>. It said <code>my aws ec2 server: Permission denied (public key)</code></p>
  
  <p>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.</p>
  
  <p>Any idea ?? Please help</p>