dongye9191
2016-10-04 06:51 阅读 105
已采纳

如何为AWS中的ec2-user设置目录的写权限?

I have created an instance in AWS with Red Hat Enterprise Linux Server release 7.2 (Maipo) and also install PHP on this server.

I have given permission using this command chown -R apache:ec2-user /var/www/html/ and also give this permission chmod -R 777 /var/www/html/image but folder is not writable this directory /var/www/html/image

Please suggest how can I make the image folder writable.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    dougudu3564 dougudu3564 2016-10-04 11:49

    run this flowing command on terminal.

    setenforce 0
    nano /etc/sysconfig/selinux
    SELINUX=disabled
    
    点赞 评论 复制链接分享
  • doutuohan6606 doutuohan6606 2016-10-04 07:07

    First of all check the directory permission by running the following command on terminal:

    stat -c '%A %a %n' *
    

    It will give the directory permission like:

    -rw-r--r-- 644 \
    drwxrwxr-x 775 Code Backup
    drwxr-xr-x 755 Desktop
    drwxr-xr-x 755 Documents
    

    And again try to change the permission by sudo like:

    sudo chown -R apache:ec2-user /var/www/html/ 
    sudo chmod -R 777 /var/www/html/image
    

    Note: you must have the rights to change the permission, that's why I added sudo (Super User)

    点赞 评论 复制链接分享

相关推荐