0

I've been trying to change all the files inside a folder to private without success. I want to use CLI because I am not a coder and I tried this code without success:

s3cmd setacl --acl-private --recursive s3://bucket-name/folder1/folder2/

And I am getting a "command not found". Any insights on this?

  • You have to install `s3cmd` to your machine first. See https://s3tools.org/download. But if you are not familiar with command line and alternatively with official AWS CLI, I would suggest to use AWS S3 Batch Operations in the console. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/batch-ops-operations.html and section called "Replace access control list". – czende Nov 03 '21 at 20:07
  • Any way I can do it directly on AWS Cloud Shell CLI? – Mateo Criado Nov 03 '21 at 20:09
  • I want to do it directly on AWS Cloud Shell CLI, not sure if that's the right command but if not I'm trying to find it. – Mateo Criado Nov 03 '21 at 20:10
  • You can't do this with a single API command. See https://stackoverflow.com/questions/46572744/how-to-change-permission-recursively-to-folder-with-aws-s3-or-aws-s3api fir some options – kgiannakakis Nov 03 '21 at 21:08
  • Side-question: Why do you wish to recursively set the ACL to private? Objects in Amazon S3 are private by default, so this activity would only be necessary if objects were previously set to a different ACL (eg ACL=public). – John Rotenstein Nov 04 '21 at 09:23
  • Because I uploaded them as public, then I want to change them back to private. – Mateo Criado Nov 04 '21 at 22:44

0 Answers0