Search code examples
amazon-web-servicesamazon-ec2filezilla

How can I give access of var/www/html to another user using AWS?


Stackoverflow community, I have to add another user in the AWS ec2 user account and also want to give the permission of /var/www/html in FileZilla / WinSCP using AWS ec2 user. I have created the user as well as the AWS user policy but it is giving the access of/in FileZilla / WinSCP. Can anyone let me know how can I solve this issue by permitting /var/www/html to a specific user?


Solution

  • I cannot totally get what are you requiring. But I think this would be a pure Linux permission problem, not an AWS problem. For changing the permission of a folder in AMZ Linux, you could do it just like that you can assign the permission to a single user or a group in other universal Linux version with chmod command.

    Here are some sample snippets for your reference:

    sudo chmod [the_new_user_you_created] 755 -R /var/www/html
    
    sudo chown -R ec2-user:apache /var/www
    

    For the best practice, you could find the recommendation for initializing a web server in AWS from this official link: To set file permissions for the Apache web server