0

I have a few Ubuntu instances on EC2 where I use the /mnt instance storage to keep logs and other fungible stuff. In order to store user logs the /mnt directory needs to have 777 permissions:

$ sudo chmod 777 /mnt

But periodically (about daily) permissions revert back to 755, for no apparent reason. Is there any way to make /mnt have write permissions for all users -- and keep it that way? I already have a task that runs on startup with the above line, but apparently it does not work.

A periodic task would be a last resort; honestly, I would like to understand the problem and solve it correctly. I have searched here and on the intertubes, no luck so far -- it is not an easily googleable question anyway.

Perhaps some mount options would do the trick? My fstab:

/dev/xvdb       /mnt    auto    defaults,nobootwait,comment=cloudconfig 0       2
6
  • What filesystem is on the volume being mounted? You should almost never have permissions set to 0777. That strongly indicates you are doing something wrong.
    – Zoredache
    Sep 13, 2013 at 22:55
  • 1
    Can you just create a sub-directory to /mnt that will have the permissions you need?
    – ernie
    Sep 13, 2013 at 23:01
  • @Zoredache Possibly, in that case I would like to know how to do things right. Sep 14, 2013 at 7:41
  • @ernie I suppose so, but I would need to recreate that directory on boot using a task. I am already setting permissions to 777 in a task and it is not working. I would like to know what is wrong so that I can be sure that any new scheme works without mucking around. Sep 14, 2013 at 7:44
  • I'm not sure what's resetting the mount points permissions (I'd guess something with how ephemeral storage works on EC2), but I'd guess that it won't change permissions on subdirectories . . .
    – ernie
    Sep 15, 2013 at 17:06

1 Answer 1

1

While I'm not sure what's causing the permissions to reset (I would guess it's a policy around the ephemeral storage on an EC2 instance), but I think a more secure way to handle this would be to create a directory on /mnt with the permissions you need.

My theory is that this directory would not have it's permissions changed by whatever maintenance Amazon is running, plus it's more secure.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .