1

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?

Blackbam
  • 113
  • 7
  • 1
    “Doesn’t work” is a very broad problem description. What error *specifically* are you getting? – MLu Apr 02 '19 at 10:52
  • If your admins are smart enough to disable ssh that you need to do your work perhaps *they* have a tested and verified way to do what you need to do? – MLu Apr 02 '19 at 10:56
  • @MLu "Doesnt work" means I am searching for the correct syntax. And no they will not provide solutions to any problem. They had to do it because of security problems. I am quite new to Linux I just hope for somebody who had a similar problem and solved it. – Blackbam Apr 02 '19 at 11:26

1 Answers1

0

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.

sysalam0
  • 71
  • 1
  • 5
  • Thank you for your answer but so far I did not find any way to use scp with with elastic beanstalk. Making the file public and downloading it e.g. with a browser is a nice hack, but not always applicable. Do you maybe have some example with the eb cli? – Blackbam Apr 16 '19 at 09:27
  • @Blackbam did you find a solution? – DataGreed Jan 27 '21 at 16:46
  • @DataGreed No sorry, long time ago. – Blackbam Jan 27 '21 at 17:06