0

I want to mount a GCP bucket on a ubuntu machine that allows user to upload files, and keep the file's ownership to the user.

Currently, I have this line in my /etc/fstab:

gcp-bucket-name /mnt/gcp-bucket-action gcsfuse rw,allow_other,file_mode=0666,dir_mode=0777

Gcp-bucket-name is my GCP bucket, and /mnt/gcp-bucket-action is the mount point.

It does allow regular users to access /mnt/gcp-bucket-action and create and delete files/dirs, but the files/dirs are owned by "root".

What do I need to change so that the user ownership will be kept on the files/dirs they created.

Thanks, Philip

Andrew Gaul
  • 2,296
  • 1
  • 12
  • 19
Philip Shangguan
  • 449
  • 5
  • 19
  • Seems you should run gcsfuse as the user who will be using the file system, not as root. The directory should be owned by user[1](https://github.com/GoogleCloudPlatform/gcsfuse/blob/master/docs/mounting.md#mounting) Do you need to run as sudo when you create file in the directory gcp-bucket-action? Please post he the permission and ownership of /mnt/gcp-bucket-action from ls -l. – Hao Z Mar 29 '21 at 19:06
  • I have a long list of users who need access to the file system, so i do not think to have a specific user run the gcsfuse command will help. – Philip Shangguan Apr 11 '21 at 19:40

0 Answers0