Permisions for browser to download file ec2
I just set up my first instance of AWS EC2 server and I'm running into an issue with permissions on a script uploading pictures. Therefore all directories created dynamically by the php script using mkdir have 'apache' as the owner which it seems doesn't have write permissions I could certainly change the apache user to 'ec2user' but I'm worried that might be a security risk.
What's the correct way of doing this? Thanks for your help. This is a pure Linux permission problem, not an AWS problem. As you see, ownership is root and not ec2-user. Should your app really write to the local storage, use a different volume, mounted in a separate directory, where no executable are available.
To allow the ec2-user account to manipulate files in this directory, you must modify the ownership and permissions of the directory. There are many ways to accomplish this task. Log out and then log back in again to pick up the new group, and then verify your membership. Log out use the exit command or close the terminal window :. To verify your membership in the apache group, reconnect to your instance, and then run the following command:. Now, ec2-user and any future members of the apache group can add, delete, and edit files in the Apache document root, enabling you to add content, such as a static website or a PHP application.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. EC2 user permissions Ask Question. Asked 6 years, 11 months ago. Mustafa Kahraman Mustafa Kahraman 91 1 1 silver badge 4 4 bronze badges. Prasad Khode 6, 11 11 gold badges 41 41 silver badges 57 57 bronze badges. Prafull Prafull 7 7 silver badges 16 16 bronze badges. Send file from Local to Server: scp -i.
Viraj Wadate Viraj Wadate 3, 24 24 silver badges 26 26 bronze badges. This just worked for me. I used a combination of two other answers to this question. Paul Roub Norman Davis Norman Davis 63 1 1 silver badge 4 4 bronze badges. This worked for me while the other answers for some reason had no effect. Not sure what the problem was. Ubuntu Vatsal Shah Vatsal Shah 1, 15 15 silver badges 21 21 bronze badges.
From Amazon : For Amazon Linux, the user name is ec2-user. For RHEL, the user name is ec2-user or root. For Ubuntu, the user name is ubuntu or root. For Centos, the user name is centos. For Fedora, the user name is ec2-user. For SUSE, the user name is ec2-user or root. Otherwise, if ec2-user and root don't work, check with your AMI provider.
Can you simply ssh with that key to your AWS host? Bryan Stenson Bryan Stenson 1 1 1 bronze badge. Yes, I can ssh with that key to my AWS host. In fact, the problem I am having is, I am on the Amazon host through ssh , so when I do cd, I can only see the files on my Amazon server, not my local Mac Downloads directory where I saved my pem file.
I can only cd to my local Mac Downloads directory when I exit my ec2 host. But if I exit to my ec2 host, I couldn't upload the file phpMyAdmin to my ec2 server. My pem's permission is , I think that's fine.
Thank you very much for the help, I found my problem by the last question you asked. It seems I can either ssh or scp, not two together. I had two terminals open one for ssh and one for scp too. Shravan40 Shravan40 7, 5 5 gold badges 25 25 silver badges 44 44 bronze badges. Marie D. Shashwat Gupta Shashwat Gupta 3, 30 30 silver badges 25 25 bronze badges.
This worked. But as a noob I can't tell if there are any security issues that would be associated with this solution. Any thoughts from the community? With regards to the local file, I get: No such file or directory — O Sc0rian Sc0rian 4 4 bronze badges. Viccari could you mention the steps to use filezilla with ec2 — Harpreet Bhatia. HarpreetBhatia should be straightforward. That should do it. You can use this: scp -i yourkeypair.
Samuel-Rosa 9 9 bronze badges. Vihaan Verma Vihaan Verma This Works Fine scp -r -i myssh. Kevin Willock Kevin Willock 1, 1 1 gold badge 13 13 silver badges 16 16 bronze badges. The easiest way is to install webmin and user the file manager java plugin from your browser. The Overflow Blog.
0コメント