CommandLine : How to copy a file from a server using a public key ?

The command to copy files from others server is : scp user@server:/filepath/filename

If you need connect with your public key :

scp -i <yourkey> youruser@server:/pathfile/filename .

Example :

 scp -i ~/.ssh/mykey camila.macedo@myhost.com.br:/mydir/temp/myfile.txt .

Leave a comment