Skip to content

Instantly share code, notes, and snippets.

@soft2help
Created May 17, 2020 10:29
Show Gist options
  • Select an option

  • Save soft2help/e33c4da224e3c3927abc4fc2a2e143bd to your computer and use it in GitHub Desktop.

Select an option

Save soft2help/e33c4da224e3c3927abc4fc2a2e143bd to your computer and use it in GitHub Desktop.
install s3fs to mpa a folder with a s3 bucket location. you should create iam user to access it
#!/bin/bash
apt-get update -y
apt-get install -yqq automake autotools-dev fuse g++ git libcurl4-openssl-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
cd /home
if [ ! -d "/home/s3fs-fuse" ] ; then
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
make install
fi
chmod 600 /s3fs/passwd-s3fs
chmod 777 /tmp
cp /s3fs/fuse.conf /etc/fuse.conf
mkdir -p /mnt/s3
chmod 777 /mnt/s3
cd /home/s3fs-fuse
#command, you can put also region
#s3fs -f yourbucket /mnt/s3 -o use_cache="/tmp" -o url="https://s3.amazonaws.com" -o allow_other -o passwd_file=/s3fs/passwd-s3fs,nonempty &
#in /etc/fuse.conf you show user_allow_other
#you sould creat a user access programation iam in aws to access your bucket with follow permissions
#{
# "Statement": [
# {
# "Effect": "Allow",
# "Action": "s3:ListAllMyBuckets",
# "Resource": "arn:aws:s3:::*"
# },
# {
# "Effect": "Allow",
# "Action": "s3:*",
# "Resource": [
# "arn:aws:s3:::your_bucket",
# "arn:aws:s3:::your_bucket/*"
# ]
# }
# ]
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment