Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change user ownership of s3fs mounted buckets

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

like image 434
itsricky Avatar asked Mar 19 '12 02:03

itsricky


People also ask

How to use bucket owner condition in S3?

To use bucket owner condition, you include a parameter with your request that specifies the expected bucket owner. Most S3 operations involve only a single bucket, and require only this single parameter to use bucket owner condition.

How to Mount Amazon S3 buckets on Linux?

s3fs is a file system in User Space (FUSE) based which is used to mount the Amazon s3 buckets. You can use the Linux/Unix command same as another Hard Drive on your server. After mounting the s3 buckets on your system you can simply use the basic Linux commands similar to run on locally attached disks.

Can I mount an S3 bucket at/SFTP using s3fs?

I'm mounting an S3 bucket at /sftp using S3FS. The problem is that S3FS cascades user permissions down through it's directory structure, meaning: I can configure files at /sftp/* to have these permissions drwxr-xr-x 1 root root which allow SFTP users to connect, but they cannot write to their home directories because they don't own them.

How do I create a s3fs mount for a single user?

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.


1 Answers

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
like image 199
Sean Avatar answered Oct 08 '22 06:10

Sean