How to mount Amazon S3 Storage inside a Linux machine

From PUBLIC-WIKI
Revision as of 12:37, 5 March 2019 by Eyales (talk | contribs) (Created page with "== Creating IAM user == * Login to the IAM console: : https://console.aws.amazon.com/iam/ * From the left pane, click on Users -> click on “Add user” -> specify the user n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Creating IAM user

  • Login to the IAM console:
https://console.aws.amazon.com/iam/
  • 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:
https://github.com/s3fs-fuse/s3fs-fuse/wiki/Installation-Notes
  • 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