'How to upload folder to EC2 using SCP

The transfer of a file works perfect.

scp -i pemfile.pem testfile [email protected]:

But the transfer of a folder does not work.

scp -r pemfile.pem testfolder [email protected]:

Shows the following message:

[email protected]: Permission denied (publickey).
lost connection

EDIT: I was missing the -i flag in the command for folder transfer. Solved. Thanks.



Solution 1:[1]

Solved. I was missing the -i flag in the command for folder transfer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 swarup beria