Change user ownership of s3fs mounted buckets
Asked Answered
T

3

8

how can I modify the user:group ownership of a s3fs mounted bucket?

I have a git installation that I would essentially like to store on my Amazon S3 account in a bucket, and then using Sparkleshare, via my web host, sync this data accross multiple machines.

- I Have set up the sparkleshare to successfully sync three machines. Works like a charm.

  • This is syncing to a folder at /home/git/dropbox No problems there.
  • I want the sync folder to me a mounted S3 bucket though
  • I can mount the buckets right next to that dropbox folder, but no love changing ownership to git:git

Problem: when you create the mount with root:root user, only that user has access to the bucket.

I tried to create the mount with S3FS logged in as the GIT user, but no luck, it still mounts and assigns permissions as the root:root user.

Do I uninstall S3FS and re-install using the GIT user?

Any help would be greatly appreciated!

Rick

Tolkan answered 19/3, 2012 at 2:50 Comment(1)
Passing the fuse option "allow_other" allows all other users to access files under the mountpoint.Stilliform
C
3

On Ubuntu I am finding that whichever user does the s3fs mount will own it, even though ls will show the owner as root:root, and in fact root cannot use it. When you did the mount as the git user are you sure you could not write to it?

Crematory answered 3/4, 2012 at 18:2 Comment(3)
Sure I could not write to it. after carefully reading the S3FS documentation, it is clear that this is a known issue, but not going to be fixed and stable any time soon.Tolkan
I have no problem mounting s3 as a different user on Ubuntu. Just need to create a directory owned by that user, and then issue the s3f3 command as that user. It is confusing, because ls will show ownership as root:root. What I found in s3fs docs is statement that only a single user can use an s3fs mount, but no reason it has to be root.Crematory
Well maybe the flaw lies in a more closed, CentOS setup on Mediatemples DV 4.0 server, not a more open and configurable Linux setup. Oh well! Back to dropbox!Tolkan
D
15

You simply want to mount it as that user. You can also automount it by adding the uid and gid that you want it mounted as. For example, your /etc/fstab would have an entry such as the following:

s3fs#s3bucketName  /mnt/point     fuse    defaults,noatime,allow_other,uid=500,gid=48,use_cache=/tmp,default_acl=public-read 0 0
Douceur answered 24/5, 2012 at 13:52 Comment(2)
And do you think that will work on a Mediatemple DV 4.0 Plesk 10.4 (Cent OS ) system? As I mentioned before any attempts to reassign the user of the mount just always fall back to root:root.Tolkan
Did default_acl=public-read make new files visible to anybody from internet?Verecund
C
3

On Ubuntu I am finding that whichever user does the s3fs mount will own it, even though ls will show the owner as root:root, and in fact root cannot use it. When you did the mount as the git user are you sure you could not write to it?

Crematory answered 3/4, 2012 at 18:2 Comment(3)
Sure I could not write to it. after carefully reading the S3FS documentation, it is clear that this is a known issue, but not going to be fixed and stable any time soon.Tolkan
I have no problem mounting s3 as a different user on Ubuntu. Just need to create a directory owned by that user, and then issue the s3f3 command as that user. It is confusing, because ls will show ownership as root:root. What I found in s3fs docs is statement that only a single user can use an s3fs mount, but no reason it has to be root.Crematory
Well maybe the flaw lies in a more closed, CentOS setup on Mediatemples DV 4.0 server, not a more open and configurable Linux setup. Oh well! Back to dropbox!Tolkan
Z
1

1.69 seems to have fixed a uid/gid issue https://code.google.com/p/s3fs/downloads/detail?name=s3fs-1.69.tar.gz&can=2&q=

Zaffer answered 17/5, 2013 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.