COPY file from one server to another
8,576
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 [email protected]:/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.
Related videos on Youtube
Author by
akr
Updated on September 18, 2022Comments
-
akr almost 2 years
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 [email protected] sudo -u xxx_bio_xxx -i
-
ss_iwe almost 6 yearsIf
scp
is givingTimeout
, first that has to be fixed! CheckConnectTimeout
parameter in ssh config! It could also be that the remote server is not reachable. -
redseven almost 6 yearsCan 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?
-
akr almost 6 yearsi am sorry i am new to linux. how to find out wat unix i am using. how can i check the ConnectTimeout
-
akr almost 6 yearsi did scp command from prod.
-
akr almost 6 years
[sys_bio_tern@prod05 tmp]$ scp /tmp/sbg.snappy [email protected]:/tmp ssh: connect to host dev01.corp.xxx.net port 22: Connection timed out lost connection
-
ss_iwe almost 6 years@komz OS Name-
cat /proc/version
, run this command:scp -vvv /tmp/sbg.snappy [email protected]:/tmp
, this will give info about the problem. Update the Question with these outputs. -
ss_iwe almost 6 yearsAlso run
ping <dev_server_ip>
command from prod to the other server! This would tell you about the connectivity! -
ss_iwe almost 6 yearsYou can also run
ping dev01.corp.xxx.net
-
Javier Salas almost 6 yearsscp is based on SSH, that would mean that you could not even connect by SSH, are you able?
-
akr almost 6 years@saisasanka i m getting this output for -vvv .
Executing: program /usr/bin/ssh host dev01.corp.xxx.net, user komz-admin, command scp -v -t /tmp OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to dev01.corp.xxx.net [10.142.128.51] port 22. debug1: connect to address 10.142.128.51 port 22: Connection timed out ssh: connect to host dev01.corp.xxx.net port 22: Connection timed out lost connection
-
-
ss_iwe almost 6 yearsIf scp is giving Timeout , first that has to be fixed! As
man rsync
saysFor remote transfers, a modern rsync uses ssh for its communications
unless otherwise modified. SoConnectTimeout
parameter is critical. It could also be that the remote host is not reachable. Its just not that thescp
failed butrsync
is going to work. -
akr almost 6 years@Syed Abdul Qadeer how to check connectivity from prod to server
-
akr almost 6 yearshow to capture ssh logs. i am not getting any logs.
-
akr almost 6 years
scp: illegal option -- 3
getting this error -
Syed Abdul Qadeer almost 6 yearsjust perform ssh root@<ip address>