简体   繁体   中英

How to change the permission for a s3 bucket mounted folder

I have Ubuntu 12.04 EC2 Instance and for my-domain i have a WordPress site.

My S3fs Version

Amazon Simple Storage Service File System 1.74
Copyright (C) 2010 Randy Rizun <rrizun@gmail.com>
License GPL2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Recently I have created a s3 bucket named mybucket and mounted in EC2 instances in the following path /var/www/my-domain/mybucket with the reference to the link http://tecadmin.net/mount-s3-bucket-centosrhel-ubuntu-using-s3fs/ and mounted permentantly using the /etc/fstab and using following command

s3fs#mybucket /var/www/mydomain/mybucket fuse netdev,use_cache=/tmp/cache,use_rrs=1,allow_other 0 0

and while i try the below command to change the ownership

chown myuser:daemon /var/www/my-domain/mybucket

I am getting this below error

chown: changing ownership of ‘/var/www/my-domain/mybucket’: Input/output error

and also when i upload any contents like images,files etc.. through S3 browser and if check that contents by giving ls -all in the S3 mounted folder in EC2 means i am getting following output

---------- 1 root       root     10 Jan  7 08:33 New Text Document.txt

and i have ftp for my domain and when i use the FTP clients like Filezilla to upload the contents to S3 the mounted Folder /var/www/my-domain/mybucket i am getting the following error.

Response:   500 OOPS: ftruncate
Error:  Critical file transfer error
Response:   500 OOPS: priv_sock_get_cmd
Error:  Connection closed by server

My questions are

  1. How to change the permissions of the S3 bucket mounted folder in a EC2 instance.
  2. How to upload the contents to S3 bucket so that it will have normal file permissions.(I perfer to upload using filezilla like a normal folder)
  3. What will be the URL for the contents of the S3 bucket folder can i use mydomain.com/mybucket or is there any other URL for accessing through web(Apache)
  4. How to resolve the File zilla 500 OOPS error

Kindly help me to resolve the above issues i am working on this for past 1 week and searched lots of articles nothing helped me .

s3fs (Fuse over S3) is not recommended as a means of accessing Amazon S3.

Amazon S3 is not a traditional file system. While s3fs attempts to make S3 appear like a filesystem, there are some important differences, such as the way security is provisioned and the fact that S3 works at the Object level -- changing one byte requires the whole object to be rewritten.

These days, it is better to use the AWS Command Line Interface (CLI) , which can upload, download and sync files with S3 (and even between S3 buckets) rather than treating it like a filesystem. This will provide a much more reliable connection to S3.

s3fs stores permissions for objects it creates in S3 user metadata. When these fields do not exist, usually because another program created the objects, it defaults to 000 permissions. You can override this with the FUSE -o umask option which inverts its octal field. For example, to override object permissions with user read-write-execute and group read-execute, mount with -o umask=027 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM