Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my Apache HTTP server on Amazon Linux AMI. I am trying to install a Prestashop on my root directory subfolder as an ec2-user via SSH.

cd /var/www/html

but when I tried to create a directory

mkdir prestashoptest

I always get this error

mkdir: cannot create directory ‘prestashoptest’: Permission denied

What should I do? How can I have a full permission?

share|improve this question

closed as off-topic by HBruijn, Jenny D, Ward, Michael Hampton Aug 6 '14 at 22:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Ward, Michael Hampton
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

You can use sudo command or sudo su for root access in Amazon ssh.


sudo mkdir prestashoptest

or use sudo su followed by the password for ec2-user and perform the simply mkdir

share|improve this answer

You don't have permission to create this directory. You have many possibilities to solve that, but anyways you need to get root access (either by the sudo bash or by the su commands, or by ssh-ing into them with root. You need the root password for all of them.)

The best were to create the directory for your project in /var/www/html with the mkdir /var/www/html/myprojectname command, and then make your user account to the owner of this directory (chown youruser:youruser /var/www/html/myproject). From that point, you will be able to edit this directory with your own user account.

Of course you could do everything as root as well, but a professional system administrator never did such thing.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.