Linux – AWS: How to download a file using eb ssh cli

amazon-web-servicesaws-clielastic-beanstalklinuxssh

Because of some security restrictions in our AWS environment I can not use SCP (for whatever reason) therefore I was using SSH to download some certain text files containing logs – the command was like this:

ssh -i '/home/user/.ssh/website-key.pem' ec2-user@ec2-xx-xx-xx-xx.eu-central-1.compute.amazonaws.com "cat /var/www/html/project-name/wp-content/themes/theme/store/log/log_2019-03-25" > /home/user/log/log_2019-03-25

Now the server admins of our companies also have disabled SSH for security reasons and only allow eb ssh. Have tried:

eb ssh project-name "cat /var/www/html/project-name/wp-content/themes/theme/store/log/log_2019-03-25" > /home/user/log/log_2019-03-25

But this does not work. Anybody knows how I can download a file via eb ssh on Amazon AWS?

Best Answer

if you can connect into the server(through ssh) you can download or send files to the server

Local to server
> scp  file.tar.gz  username@IP:/location/of/file

Server to local
> scp username@IP:/location/of/file/file.tar.gz  /route/on/local/

I hope this to be helpful.

If you can not access through ssh, you can change for a moment the document root of a web server

After that, you will see the file when you enter for example 128.190.1.23/ on you browser, and you ll be able to download it.