Change folder read / write access on Ubuntu Linux

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

I set the volume of EBS to

 /mnt/my-address 

But the servlet cannot create a folder and write a file?

My question

Why can't Java sevlet create a folder on an installed Amazon EBS volume?

+7
source share
1 answer

It looks like your folder does not have the correct read and write permissions.

Try to provide read and write access to all users in the appropriate directory, for example:

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

If it’s not convenient for you to grant write permissions to everyone, you can fine tune permissions by playing with property rights and groups, but I need more information about your setup to help you with this.

Edit : if only the ec2 user is the only one who needs access, you can change the ownership of the directory for this user, and then grant access only to him:

 sudo chown -R ec2-user:ec2-user /mnt/my-address sudo chmod -R u+rw,go-rw /mnt/my-address 
+21
source

All Articles