1

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?

2
5

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

Try

sudo mkdir prestashoptest

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

2

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.

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