Copying files via SSH between two remote servers

7

How to copy files from server1 to server2 via SSH with just one command line, and am I not logged in to any of them?

I'm on a 3rd machine. And I have the credentials of both.

    
asked by anonymous 31.01.2014 / 17:48

4 answers

11

You can do this quietly, just use the scp command.

scp usuario1@host1:path/* usuario2@host2:path/*

If the copy is only of files use /* if it has folder use -r in scp.

scp -r usuario1@host1:path usuario2@host2:path
    
31.01.2014 / 17:56
0

use scp; Log in to the machine and send it to the machine b

link

$ scp / var / lib / files [email protected]: / home / damasceno

    
31.01.2014 / 17:54
0
scp arquivo usuario@servidor:/home/usuario

Do not roll?

    
31.01.2014 / 17:53
0

If you are using Linux and are in a graphical environment, open the TERMINAL (Depending on the Interface that is Ex .: Gnome, Kde, LXDE ...), open three tabs and see the source / target content that you want to copy.

Or if you're on Windows, use Putty .

Once this is done, run the command:

scp "nome do arquivo / diretório " "nome do usuário"@"endereço ip da máquina":/"destino"
    
31.01.2014 / 21:59