Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

scp copy directory to another server with private key auth

is there something wrong with this scp command ?

scp -C -i ./remoteServerKey.ppk -r /var/www/* [email protected]:/var/www 

I use the same .ppk as in putty and enter the same passphrase, but it asks me 3 times and than says connection denied. I thought I used it before and it worked, but it isn´t atm. If it is wrong, how should I do it ?

like image 539
user2693017 Avatar asked Dec 11 '13 21:12

user2693017


2 Answers

or you can also do ( for pem file )

 scp -r -i file.pem [email protected]:/home/backup /home/user/Desktop/ 
like image 84
Abhishek Goel Avatar answered Oct 06 '22 00:10

Abhishek Goel


Covert .ppk to id_rsa using tool PuttyGen, (http://mydailyfindingsit.blogspot.in/2015/08/create-keys-for-your-linux-machine.html) and

scp -C -i ./id_rsa -r /var/www/* [email protected]:/var/www 

it should work !

like image 20
Lokesh Avatar answered Oct 05 '22 23:10

Lokesh