-1

I have to get some files from production to DEV server. SCP command gives the timeout.

I do not have ip and I connect to the server using ssh command as below.

ssh komz-admin@pxxxxxxx04.corp.xxx.net
sudo -u xxx_bio_xxx -i

closed as unclear what you're asking by Sparhawk, Jeff Schaller, schily, Jesse_b, Toby Speight Aug 6 '18 at 12:45

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • If scp is giving Timeout , first that has to be fixed! Check ConnectTimeout parameter in ssh config! It could also be that the remote server is not reachable. – sai sasanka Aug 6 '18 at 10:46
  • Can you specify more? Where you start the scp command, on the prod server or on the dev server? (please copy&paste the ommand as well) And when it gives you timeout? It can not start the copy or starts the copy, but runs into timeout later? – redseven Aug 6 '18 at 11:04
  • i am sorry i am new to linux. how to find out wat unix i am using. how can i check the ConnectTimeout – akr Aug 6 '18 at 11:45
  • i did scp command from prod. – akr Aug 6 '18 at 11:46
  • [sys_bio_tern@prod05 tmp]$ scp /tmp/sbg.snappy komz-admin@dev01.corp.xxx.net:/tmp ssh: connect to host dev01.corp.xxx.net port 22: Connection timed out lost connection – akr Aug 6 '18 at 11:48
2

Looks like your prod server can't reach the dev server (on ssh). I assume you can reach both from your workstation. You can use scp 3 hosts copy, which copies between hosts using a 3rd one (in your case prod05 -> workstation -> dev 01). Of course it's not the fastest way to copy, both perfect when you have to copy once and you have firewall issues.

Run the following on your workstation (where you can reach both):

scp -3 prod05:/tmp/sbg.snappy admin@dev01.corp.xxx.net:/tmp

From the man page of scp:

 -3      Copies between two remote hosts are transferred through the local host.
         Without this option the data is copied directly between the two
         remote hosts.  Note that this option disables the progress meter.
  • scp: illegal option -- 3 getting this error – akr Aug 7 '18 at 3:10
-1

First, check ssh connectivity from production to DEV server. If it is ok then do following steps,

Use RSYNC utility for file transfer,

Example:

rsync -avz "source filename" user@x.x.x.x:"destination path"

And if ssh connectivity fails, then check logs and print output here

  • If scp is giving Timeout , first that has to be fixed! As man rsync says For remote transfers, a modern rsync uses ssh for its communications unless otherwise modified. So ConnectTimeout parameter is critical. It could also be that the remote host is not reachable. Its just not that the scp failed but rsync is going to work. – sai sasanka Aug 6 '18 at 10:50
  • @Syed Abdul Qadeer how to check connectivity from prod to server – akr Aug 6 '18 at 11:52
  • how to capture ssh logs. i am not getting any logs. – akr Aug 6 '18 at 11:58
  • just perform ssh root@<ip address> – Syed Abdul Qadeer Aug 7 '18 at 4:50

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