Home c# SCP file transfer between servers

SCP file transfer between servers

Author

Date

Category

You need to organize data transfer from one remote server to another, without downloading to my computer. This is done through SCP, but I did not find any lube that supports it. Maybe someone came across this?


Answer 1, Authority 100%

What prevents you from entering using WINSCP on SSH and on the name of the server do the way described below or use Putty?

Copy the .bash_history file from the first server, from the home directory – to the home directory of the second and immediately change it the name and extension on bash_history.log you will need to enter two times passwords from The first server and from the second. Naturally, the input will not be displayed in the terminal.

If there is an active SSH connection, then burst it with the command exit

$ scp user@remote_1.ru: ~ / .bash_history user@remote_2.ru: ~ / bash_history.log

SCP (Secure Copy) is a program for remote copying of the panels over the network between hosts.
It uses SSH to transmit data, the same authentication and the same security measures as SSH.
While copying the source file to the destination file, which already exists, SCP overwrites the destination file.


If the destination file does not yet exist, then an empty file is created, it is set to the destination file name and the contents of the copied file are written to it !!!

Example 1: Copy the file “file.txt” from a remote server on
Local computer.

$ scp [email protected]: file.txt / Some / Local / Directory

Example 2: Copy the file “file.txt” from a local computer on
Remote server.

$ SCP file.txt [email protected]: / Some / Remote / Directory

Example 3: Copy the “Dir1” folder from a local host to the directory
“Dir2” on a remote host.

$ scp -r dir1 [email protected]: / some / remote / directory / dir2

Example 4: Copy the file “file.txt” from one remote server “Remote.Host1”
On another remote server “Remote.host2”.

$ scp [email protected]: /directory/file.txt [email protected]: / sometime / directory /

Example 5: Copy the files “file1.txt” and “file2.txt” from a local computer in
Your home directory on a remote server.

$ scp file1.txt file2.txt [email protected]: ~

Example 6: Copy the file “file.txt” from a local host to a remote host using port 2222.

$ scp -p 2222 file.txt [email protected]: / Some / Remote / Directory

Example 7: Copy the file “file.txt” from a local computer to your home directory on a remote server.
We save the time of change and the time of access and the right of the fast pala.

$ scp -p file.txt [email protected]: ~

Example 8: Copy the file “file.txt” from a local computer to your home directory on a remote server.
Increase SCP speed changing encryption algorithm with AES-128 (default) on Blowfish.

$ scp -c blowfish file.txt [email protected]: ~

Example 9: Copy the file “file.txt” from a local computer to your home directory on a remote server.
Limit the width of the channel used by the SCP command to 100 kbit / s.

$ scp -l 100 file.txt [email protected]: ~

Example 10: Copy multiple files from a remote host to the current directory on your local host.

$ scp [email protected]: ~ / \ {File1, File2, File3 \}.

it is taken from here

p.s. If the receiving side is rsync, then you can use it:

rsync -azp [email protected]: ~ / [email protected]: ~ /

– recursively with the desperation, copying rights and compression on the fly rolls a home directory from one server to another.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions