How to mount Amazon S3 Storage inside a Linux machine
Creating IAM user
- Login to the IAM console:
- From the left pane, click on Users -> click on “Add user” -> specify the user name -> access type: “Programmatic access” -> do not select “AWS Management Console access” -> click “Next: Permissions”
- From the “add user to group”, click on “Create group” -> from the policy list, select “AmazonS3FullAccess” -> click “Next: Review” -> click on “Create user”
- Download the CSV file with the “Access key ID” and “Secret access key” and save the CSV file in a secure location
- Click Close
S3FS installation
- Login using SSH to the target Linux machine using privileged account.
- Follow the instructions below to install the S3FS Fuse adapter:
- Run the command sudo vi /etc/passwd-s3fs to create config file with the following content:
- bucketName:accessKeyId:secretAccessKey
- Note 1: Replace bucketName, with the target bucket name
- Note 2: Replace accessKeyId, with the relevant value from the credentials created on the IAM console
- Note 3: Replace secretAccessKey, with the relevant value from the credentials created on the IAM console
- Change the permissions of the passwd-s3fs file:
- sudo chown ec2-user:ec2-user /etc/passwd-s3fs
- sudo chmod 600 /etc/passwd-s3fs
- To view the content of the Google cloud storage bucket, switch to the new mount point:
- cd /dev/cloudstorage