我遇到了使用S3FS的問題。我使用允許其他用戶使用S3FS桶目錄的權限
[email protected]:~$ /usr/bin/s3fs --version
Amazon Simple Storage Service File System 1.71
而且我有安裝在/usr/share/myapp/s3fs-password
與600
權限密碼文件。
我成功安裝了S3存儲桶。
sudo /usr/bin/s3fs -o allow_other -opasswd_file=/usr/share/myapp/s3fs-password -ouse_cache=/tmp mybucket.example.com /bucket
而且我已經在/etc/fuse.conf
啓用user_allow_other
當我試圖創建在桶文件作爲root
它的工作。
[email protected]:~$ sudo su
[email protected]:/home/ubuntu# cd /bucket
[email protected]:/bucket# echo 'Hello World!' > test-`date +%s`.txt
[email protected]:/bucket# ls
test-1373359118.txt
我檢查了存儲桶mybucket.example.com
的內容併成功創建了該文件。
但是我有寫作到目錄/bucket
不同用戶的困難。
[email protected]:/bucket# exit
[email protected]:~$ cd /bucket
[email protected]:/bucket$ echo 'Hello World!' > test-`date +%s`.txt
-bash: test-1373359543.txt: Permission denied
我拼命搭配chmod-ING於777
的test-1373359118.txt
。我可以寫入到文件
[email protected]:/bucket$ sudo chmod 777 test-1373359118.txt
[email protected]:/bucket$ echo 'Test' > test-1373359118.txt
[email protected]:/bucket$ cat test-1373359118.txt
Test
有趣地,我可以創建一個目錄桶內中,chmod設置爲777
,並寫入文件存在。
[email protected]:/bucket$ sudo mkdir -m 1777 test
[email protected]:/bucket$ ls
test test-1373359118.txt
[email protected]:/bucket$ cd test
[email protected]x-x:/bucket/test$ echo 'Hello World!' > test-`date +%s`.txt
[email protected]:/bucket/test$ ls
test-1373360059.txt
[email protected]:/bucket/test$ cat test-1373360059.txt
Hello World
但後來我嘗試
[email protected]:~$ sudo chmod 777 /mybucket
chmod: changing permissions of '/mybucket': Input/output error
它沒有工作。
起初,我想利用這個/bucket
目錄從位於幾個EC2的機器我的LAMP堆棧存儲大量的,很少訪問的文件。 (我認爲在沒有使用AWS PHP SDK製作特殊處理庫的情況下使用它就足夠了,但這不是重點)。
由於這個原因,我可以使用/mybucket
中的一個目錄來存儲文件。但我只是好奇,如果有一種方法可以讓整個/mybucket
其他用戶?
感謝您的建議。我會先看看這個。 –