2015-02-06 115 views
0

我已經創建了存儲桶,爲全新的IAM用戶添加了一個全面訪問策略,並試圖將存儲桶安裝爲我的服務器上的存檔文件夾。 它只是不走。我在一個特殊的雲端,也是我的託管公司的唯一一個存儲空間不足的地方。 S3安裝的存檔存儲聽起來像是這個想法。s3fs:無法訪問存儲桶

但是當我嘗試並遵循所有可用策略時,s3fs無法訪問存儲桶。我知道這是我,我只是不知道如何。

 
[[email protected] s3fs-1.74]# s3fs -f -d -d -o use_cache=/tmp mybucketname /opt/bigarchive 
    set_moutpoint_attribute(3291): PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40777) 
FUSE library version: 2.9.3 
nullpath_ok: 0 
nopath: 0 
utime_omit_ok: 0 
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0 
INIT: 7.13 
flags=0x0000b07b 
max_readahead=0x00020000 
s3fs_init(2595): init 
s3fs_check_service(2894): check services. 
    CheckBucket(2228): check a bucket. 
    RequestPerform(1467): connecting to URL http://mybucketname.s3.amazonaws.com/ 
RequestPerform(1595): ### CURLE_HTTP_RETURNED_ERROR 
RequestPerform(1600): HTTP response code =403 
s3fs: Failed to access bucket. 

我斗的政策是:

 
{ 
    "Version": "2012-10-17", 
    "Id": "mybucketnameS3PolicyId", 
    "Statement": [ 
     { 
      "Sid": "IPAllow", 
      "Effect": "Allow", 
      "Principal": "*", 
      "Action": "s3:*", 
      "Resource": "arn:aws:s3:::mybucketname /*", 
      "Condition": { 
       "IpAddress": { 
        "aws:SourceIp": "MY.PUBLIC.IP.ADDRESS" 
       } 
      } 
     } 
    ] 
} 

我的IAM政策是:

 
{ 
    "Version": "2012-10-17", 
    "Statement": [ 
     { 
      "Sid": "Stmt1423176468000", 
      "Effect": "Allow", 
      "Action": [ 
       "s3:*" 
      ], 
      "Resource": [ 
       "arn:aws:s3:::mybucketname/*", 
       "arn:aws:s3:::mybucketname" 
      ] 
     } 
    ] 
} 

S3fs安裝:

 
[[email protected] s3fs-1.74]# s3fs --version 
Amazon Simple Storage Service File System 1.74 
Copyright (C) 2010 Randy Rizun 
License GPL2: GNU GPL version 2 
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law. 

保險絲,以及:

 
[[email protected] s3fs-1.74]# pkg-config --modversion fuse 
2.9.3 
+0

似乎您的安全證書設置有問題。我認爲s3fs沒有指定緩存大小限制。您可能必須手動檢查並刪除緩存或自動化它,例如使用cron。 – phobic 2015-02-06 08:25:03

+0

是@phobic,我很瞭解(s3fs的調試消息返回403 Forbidden)。我正在尋找一些可能的問題。 – 2015-02-06 18:24:31

回答

0

你的動作要

"Action": "s3:*"

此外,還要確保你的IP地址是S3將看到的IP地址(即外部IP地址)

+0

納特,我編輯我的帖子,所以'*'顯示正確。這不是問題,這是政策的方式。 IP地址是公開的。 – 2015-02-06 18:21:09

+0

您是否嘗試使用CloudBerry或其他S3客戶端的IAM策略訪問存儲桶? – Nat 2015-02-06 23:39:47

+0

我曾在亞馬遜上爲IAM做過策略模擬器測試,它工作正常。 – 2015-02-07 00:08:43