Howto copy-transfer files-directories between two servers without FTP, rsync and scp

Posted by HostsVault | Posted in How-To's | Posted on 17-05-2009-05-2008

0

I know it’s a strange situation that probably wont happen but maybe you got stuck needing to copy files between two accounts on two different servers and your server admin have locked down access to FTP, rsync and scp ,here is how to copy this files regardless of all this restrictions all you need is nc (Netcat) and you don’t even need to be root

on the destination server run :

nc -l 1212 | gunzip -c | tar xvfp -

Explanation :
This will make netcat listen on port 1212 (make sure to use port over 1024 since you’re not root) piping all incoming content to gunzip to uncompress it then piping it again to tar creating files/directories with verbose switch on so you see what’s being created

On source server run :

tar cfp - /home/myuser/mydir | gzip -c | nc -w 10 destination_ip 1212

Explanation :
This will make tar start archiving your files under the directory you specified piping it to gzip for compression then to netcat that will pass it to destination_ip on designated port on timeout of 10 seconds just for sake of slow networks.

Hope this helps someone out there in the cyber space.

VN:F [1.9.13_1145]
Rating: 6.5/10 (8 votes cast)
VN:F [1.9.13_1145]
Rating: +3 (from 5 votes)
Howto copy-transfer files-directories between two servers without FTP, rsync and scp, 6.5 out of 10 based on 8 ratings

Write a comment