Amazon Simple Storage Service (Amazon S3) is a scalable object storage service widely used for backup, data archiving, and hosting static websites. Creating a public S3 bucket and uploading files is a common task for those looking to make files accessible over the internet. This guide will walk you through the steps to create a public S3 bucket and upload files to it.
Before you can SSH into your EC2 instance, you need to have the following:
1. AWS Account: You need an AWS account. If you don’t have create one.
A Step-by-Step Guide for Creating an AWS Account. Click here
2. AWS CLI (optional) For those comfortable with command line interfaces, the AWS CLI can be used to manage S3 buckets. You can download and install it from the AWS CLI page.






Choose the AWS region where you want your bucket to be created.
Leave the default settings for the rest of the options and click Create bucket.


Go to the Permissions tab.
Under Block public access (bucket settings), click on Edit.




{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
}
]
}

Replace your-bucket-name with the name of your bucket.
Click Save changes.

Using the AWS Management Console
Go back to the Objects tab.
Click on the Upload button.


Click Upload to start the upload process.
Once uploaded, the files will be listed in your bucket.

Use the following command to upload a file:
aws s3 cp path/to/your/file s3://your-bucket-name/
path/to/your/file with the path to your file and your-bucket-name with the name of your S3 bucket.Once the files are uploaded, you can access them publicly.
The URL for each file will be in the format: https://your-bucket-name.s3.amazonaws.com/your-file-name.
For example, if your bucket name is my-public-bucket and your file name is example.jpg, the public URL will be: https://my-public-bucket.s3.amazonaws.com/example.jpg.
Security: Be cautious when making a bucket public. Only make public the data you intend to share publicly. Avoid storing sensitive data in public buckets.
Bucket Naming: Choose a meaningful and descriptive bucket name.
IAM Policies: Use IAM roles and policies to manage permissions effectively.
Monitor Usage: Regularly check the usage and access logs of your S3 bucket to ensure there is no unauthorized access.
SSH-ing into a Linux EC2 instance is a fundamental skill for anyone working with AWS. By following these steps, you should be able to securely connect to your instance and manage it as needed. Remember to keep your private key secure and to follow best practices for securing your instances, such as regularly updating software and using security groups effectively. By mastering these basics, you can take full advantage of the flexibility and power that AWS EC2 provides.