Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7447481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:36:57+00:00 2026-05-29T12:36:57+00:00

How do you make an AWS S3 public folder private again? I was testing

  • 0

How do you make an AWS S3 public folder private again?

I was testing out some staging data, so I made the entire folder public within a bucket. I’d like to restrict its access again. So how do I make the folder private again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T12:37:00+00:00Added an answer on May 29, 2026 at 12:37 pm

    From what I understand, the ‘Make public’ option in the managment console recursively adds a public grant for every object ‘in’ the directory.
    You can see this by right-clicking on one file, then click on ‘Properties’. You then need to click on ‘Permissions’ and there should be a line:

     Grantee:  Everyone  [x] open/download  [] view permissions   [] edit permission.
    

    If you upload a new file within this directory it won’t have this public access set and therefore be private.

    You need to remove public read permission one by one, either manually if you only have a few keys or by using a script.

    I wrote a small script in Python with the ‘boto’ module to recursively remove the ‘public read’ attribute of all keys in a S3 folder:

    #!/usr/bin/env python
    #remove public read right for all keys within a directory
    
    #usage: remove_public.py bucketName folderName
    
    import sys
    import boto3
    
    BUCKET = sys.argv[1]
    PATH = sys.argv[2]
    s3client = boto3.client("s3")
    paginator = s3client.get_paginator('list_objects_v2')
    page_iterator = paginator.paginate(Bucket=BUCKET, Prefix=PATH)
    for page in page_iterator:
        keys = page['Contents']
        for k in keys:
            response = s3client.put_object_acl(
                            ACL='private',
                            Bucket=BUCKET,
                            Key=k['Key']
                        )
    

    I tested it in a folder with (only) 2 objects and it worked. If you have lots of keys it may take some time to complete and a parallel approach might be necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Cassandra cluster on AWS. i would like to make some process
We make infrastructure services (data retrieval and storage) and small smart client applications (fancy
To make a JavaScript class with a public method I'd do something like: function
Amazon Cloud Services (AWS) has provided the ready to use Library to make calls
I have a folder in a bucket with 10,000 files. There seems to be
I've been using AWS Elastic Beanstalk for deploying my application in Beta, Staging &
I have an AWS EC2 instance running. I've tried to make a connection to
Make a new AS3 Document in Flash, paste in the following code and run
make is not only useful for building your programming project, but it seems to
To make it short: hibernate doesn't support projections and query by example? I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.