I'm trying to use SCP to copy a file from a remote VPS which uses private keys to a local machine.
I'm getting different errors depending on what I try and I am not sure what the correct method should be.
Here is what I have tried:
scp -i ~/.ssh/private-key [email protected]:/var/www/html/index.html /var/www/html/
This asks for the private key password, then gives the error /var/www/html is a directory.
scp -i ~/.ssh/private-key [email protected]:/var/www/html/index.html root@localhost:/var/www/html/
This asks for the private key password, then says Host Key Verification Failed. lost connection.
scp -i ~/.ssh/private-key [email protected]:/var/www/html/index.html [email protected]:/var/www/html/
This simply gives a blank screen which seemingly lasts forever. I assume this might be the method that is actually working, but may just be copying incredibly slowly?
I have tried connecting to the server using ssh, with the same key file, which works fine, so I'm not sure what the issue is.
Does anyone have a solution, or knows what I am doing wrong? Thanks