1

First of all, I created a simple bucket in S3.

After that, I created a server in AWS SFTP Transfer service https://aws.amazon.com/sftp/.

Then I created a new user inside AWS SFTP for test purposes and attached role that has AdministratorAccess policy to it.

Finally, I tried to connect with sftp terminal command. It connect successfully. But when I am on the server I can't do any of sftp commands. For example:

sftp> dir
Couldn't read directory: Failure

Why I can't execute any SFTP command on the server?

1 Answer 1

1

I ran into this as well. Please refer to the article here for details.

But most likely it is wrong set up of a role. Be aware that you have to not only set up the role with access to s3 bucket. For example like this

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::data-transfer-inbound"
        },
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": "arn:aws:s3:::data-transfer-inbound/jeff/*"
        }
    ]
}

You also have to set up trusted entity (principal) for the role to assume it. In this case the principal should be transfer.amazonaws.com

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "transfer.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

In the role you can put the above in on the tab "Trust relationships".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .