# S3 repository and backup path

**URL:** <https://kopia.discourse.group/t/s3-repository-and-backup-path/1367>\
**Category:** Support\
**Created:** [August 19, 2022, 5:11pm UTC](https://kopia.discourse.group/t/s3-repository-and-backup-path/1367 "2022-08-19T17:11:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luis\_Ito](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/luis_ito/32/424_2.png) [@Luis\_Ito](https://kopia.discourse.group/u/Luis_Ito)\
**Post date:** [August 19, 2022, 5:11pm UTC](https://kopia.discourse.group/t/s3-repository-and-backup-path/1367/1 "2022-08-19T17:11:16Z")

</div>

Hello, along with my backups im learning a bit of minio, s3 and policies. I want to receive backups from multiple devices and need to place them inside directories of the bucket because the policy uses username as a wildcard after the bucketname. Kopia was working excellent before using policies…

When using Duplicati I’ve noticed I need to allow ListAllMyBuckets when creating the job and then it can be removed. However in kopia I keep receiving an error…

> sudo /usr/bin/kopia --config-file=/home/myself/.config/kopia/repository.config repository connect s3 --access-key=user\_asas --bucket=repo-tepetrab --description=“el repo” --endpoint=[my.server.com](http://my.server.com) --secret-access-key=trytrytrytry --prefix=user\_asas/

> ERROR can’t connect to storage: unable to determine if bucket “repo-tepetrab” exists: Access Denied.

How can this be achieved?

thanks!

```auto
{
    "Version": "2012-10-17",
    "Statement": [
      {
        "Sid": "AllowGroupToSeeBucketListInTheConsole",
        "Effect": "Allow",
        "Action": [
          "s3:GetBucketLocation",
          "s3:ListAllMyBuckets"
        ],
        "Resource": [
          "arn:aws:s3:::*"
        ]
      },
      {
        "Effect": "Allow",
        "Action": [
          "s3:ListBucket"
        ],
        "Resource": [   
          "arn:aws:s3:::repo-tepetrab"
        ],
        "Condition": {
          "StringLike": {
            "s3:prefix": [
              "${aws:username}",
              "${aws:username}/*"
            ]
          }
        }
      },
      {
        "Effect": "Allow",
        "Action": [
          "s3:GetObject",
          "s3:PutObject",
          "s3:*"
        ],
        "Resource": [
          "arn:aws:s3:::repo-tepetrab/${aws:username}/*"
        ]
      }
    ]
  }

```

---

<div class="post-metadata">

**Author:** ![ajfriesen](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/ajfriesen/32/477_2.png) [@ajfriesen](https://kopia.discourse.group/u/ajfriesen)\
**Post date:** [August 31, 2022, 3:08pm UTC](https://kopia.discourse.group/t/s3-repository-and-backup-path/1367/2 "2022-08-31T15:08:24Z")

</div>

I had the same error.

When I changed the port from 9000 to 9001 (or the other way around, do t remember) everything worked fine again.

Maybe this can help you as well.

---

<div class="post-metadata">

**Author:** ![Luis\_Ito](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/luis_ito/32/424_2.png) [@Luis\_Ito](https://kopia.discourse.group/u/Luis_Ito)\
**Post date:** [August 31, 2022, 3:45pm UTC](https://kopia.discourse.group/t/s3-repository-and-backup-path/1367/3 "2022-08-31T15:45:37Z")

</div>

Thanks! are aware what’s listening on that port? I think i have minio console in there.
