Change read/write access of a folder in Ubuntu Linux

后端 未结 1 2007
攒了一身酷
攒了一身酷 2021-02-04 15:07

I want to create a folder and write a file in the created folder in an Amazon EBS volume from a Java Servlet installed on Amazon EC2 running Ubuntu.

I have

相关标签:
1条回答
  • 2021-02-04 15:59

    Looks like your folder does not have the correct read/write permissions.

    Try granting read-write access to all users to the directory in question, e.g.:

    sudo chmod -R ugo+rw /mnt/my-address
    

    If you are uncomfortable with granting write permissions to all, you could fine tune the permissions by playing with ownership and groups, but I would need more info about your setup to help you with that.

    Edit: if the ec2-user is the only one needing access, you could change the ownership of the directory to that user and then grant access to only him:

    sudo chown -R ec2-user:ec2-user /mnt/my-address
    sudo chmod -R u+rw,go-rw /mnt/my-address
    
    0 讨论(0)
提交回复
热议问题