mount AWS S3 as share drive

AWS S3 is a popular choice for cloud storage, due to its cost and stability.

It will be super convenient if we can mount the S3 bucket, so that to access it through FTP or from local OS directly.

 

Steps:

  1. create the S3 bucket
  2. set up the proper access
    1. either through s3 policy
    2. or through IAM policy
      1. if through IAM policy, need to create the role, associate the role with the policy
  3. install s3fs either from source or package
    #ubuntu
    sudo apt install s3fs
    
    
    #from source
    
    git clone https://github.com/s3fs-fuse/s3fs-fuse.git
    cd s3fs-fuse
    ./autogen.sh
    ./configure
    make
    sudo make install

     

  4. mount by role

     

    mkdir /mnt-drive && s3fs  -o iam_role=”role-from-step-2” -o allow_other S3-bucket /mnt-drive

     

  5. mount by key
    1. mkdir /mnt-drive && s3fs -o passwd_file=${HOME}/.passwd-s3fs
      -o allow_other S3-bucket /mnt-drive
  6. FTP
    1. install vsftpd

      systemctl start vsftpd

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s