Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chmod: changing permissions - Operation not permitted #121

Closed
jackexu opened this issue Dec 29, 2024 · 1 comment
Closed

chmod: changing permissions - Operation not permitted #121

jackexu opened this issue Dec 29, 2024 · 1 comment

Comments

@jackexu
Copy link

jackexu commented Dec 29, 2024

Got error message chmod: changing permissions of ‘/home/ec2-user/SageMaker/efs’: Operation not permitted when executing below

Enabled root access in SageMaker Notebook instance and the file system policy below - if delete the file system policy then it's working

{
    "Version": "2012-10-17",
    "Id": "efs-policy-wizard-a5793782-0072-4e26-978c-c838d8e1cf95",
    "Statement": [
        {
            "Sid": "efs-statement-3838fba9-018f-431e-b655-b25e817fb97c",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": [
                "elasticfilesystem:ClientWrite",
                "elasticfilesystem:ClientMount"
            ],
            "Condition": {
                "Bool": {
                    "elasticfilesystem:AccessedViaMountTarget": "true"
                }
            }
        }
    ]
}
@jackexu
Copy link
Author

jackexu commented Dec 29, 2024

NVM - Found a fix: need to give ClientRootAccess to SageMaker Notebook Role

{
    "Version": "2012-10-17",
    "Id": "efs-policy-wizard-xxx",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::<account_id>:root"
            },
            "Action": [
                "elasticfilesystem:ClientWrite",
                "elasticfilesystem:ClientMount"
            ],
            "Resource": "<efs_arn>",
            "Condition": {
                "Bool": {
                    "elasticfilesystem:AccessedViaMountTarget": "true"
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "<sagemaker_role_arn>"
            },
            "Action": [
                "elasticfilesystem:ClientRootAccess",
                "elasticfilesystem:ClientWrite",
                "elasticfilesystem:ClientMount"
            ],
            "Resource": "<efs_arn>"
        }
    ]
}

@jackexu jackexu closed this as completed Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant