minio / minio

The Object Store for AI Data Infrastructure

Home Page:https://min.io/download

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sftp not support directory permission

muziling opened this issue · comments

  • Version used: minio-20240510014138.0.0-1.x86_64.rpm
  • Server setup and configuration: --sftp='address=:12121' --sftp='ssh-private-key=/home/minio-user/.ssh/id_rsa'
  • Operating System and version (uname -a): centos 7.9 3.10.0-1160.el7.x86_64

Create a bucket name test, with two directory dir1 and dir2
Create a policy

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

Create a user assign this policy.
sftp command login minio sftp , exec ls command , fail output

remote readdir("/"): Failure

exec ls test/dir1 output not found

Permissions are handled via IAM policies and IAM policies require when you want conditions you need to provide more extended actions and it's relevant conditions.

https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_s3_home-directory-console.html

Understand how to do that here.