Lightsail: Download Folder by SCP

Keywords: General - AWS - How to - Other

Description:
Hey,

I tried anything I can. Can you explain to me how do I download a folder by using ssh/scp on bitnami Lightsail? What is the trick?

sudo scp -i KEY-FILE-PATH-ON-SERVER -r deamon@IP:PATH-To-FOLDER-THAT-I-WANT-TO-DOWNLOAD* /LOCAL FOLDER PATH/

KEY-FILE-PATH-ON-SERVER = I uploaded the privat .pem key on the server for the time of downloading. Because I regocnized that I cannot trigger the .pem file from my local pc. My idea was to remove the file after the download will be completed (of course)

deamon@IP = I tried to make the .key file on server secured by permission chmod 600 + deamon user. But it is still “permission denied”.

Can somebody show how do I conntect by scp to my Lightsail Application and download a folder (-r) to my local pc?

Hi @eSpox,

The fastest way is to create a tarball of the folder and then download that as a file. First ssh into the machine:

ssh -i KEY-FILE-PATH-ON-SERVER bitnami@IP
cd /path/to/parent/
tar folder.tgz FOLDERNAME
mv folder.tgz ~/
scp -i KEY-FILE-PATH-ON-SERVER bitnami@IP:folder.tgz .
tar xf folder.tgz

Best regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.