Skip to content

Instantly share code, notes, and snippets.

@Darkflib
Last active August 9, 2018 13:07
Show Gist options
  • Select an option

  • Save Darkflib/84308ada9920dab486a1f67acb6b66c4 to your computer and use it in GitHub Desktop.

Select an option

Save Darkflib/84308ada9920dab486a1f67acb6b66c4 to your computer and use it in GitHub Desktop.
# add the password to the s3 credentials file...
echo $ACCESS_KEY:$SECRET_KEY > ~/.passwd-s3fs
# if you have multiple buckets, there is a different syntax
echo $BUCKET:$ACCESS_KEY:$SECRET_KEY > ~/.passwd-s3fs
# Create the directory where the S3 bucket will be mounted
mkdir -p ~/s3/mattsmells
# Mount the bucket
s3fs mattsmells ~/s3/mattsmells -o url=https://s3.wasabisys.com/ -o use_path_request_style
# encrypted bucket
openssl rand -hex 16 > ~/.bucket-encrypt.key
chmod 600 ~/.bucket-encrypt.key
s3fs mattsmells ~/s3/mattsmells -o url=https://s3.wasabisys.com/ -o use_path_request_style -ouse_sse=custom:$HOME/.bucket-encrypt.key
Note: even if public, you wont be able to download the file without some additional params...
<Error>
<Code>InvalidRequest</Code>
<Message>
The object was stored using a form of Server Side Encryption. The correct parameters must be provided to retrieve the object.
</Message>
<RequestId>E1220BEEEF6651BF</RequestId>
<HostId>
MZFrXRrbA5pVTlDAQzPy6jDm+H1zGe+GMf4woHIXJW55xWy75145yRf814ThA0mt9OYDTyvEp/ei
</HostId>
</Error>
-ouse_cache=/tmp - use /tmp as a cache directory
-o allow_other - allow other users to access the mounted fs (by default allows access to the mounting user only)
Also, before using allow_other ensure the following is enabled in /etc/fuse.conf:
user_allow_other
It is disabled by default
mc109472:~ mpreston1$ brew cask install osxfuse

Updating Homebrew...
==> Tapping homebrew/cask
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Counting objects: 4118, done.
remote: Compressing objects: 100% (4100/4100), done.
remote: Total 4118 (delta 26), reused 629 (delta 15), pack-reused 0
Receiving objects: 100% (4118/4118), 1.29 MiB | 508.00 KiB/s, done.
Resolving deltas: 100% (26/26), done.
Checking out files: 100% (4103/4103), done.
Tapped 1 command and 4020 casks (4,127 files, 4.1MB).
==> Caveats
You must reboot for the installation of osxfuse to take effect.

==> Satisfying dependencies
==> Downloading https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.8.2/osxfuse-3.8.2.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask osxfuse
==> Installing Cask osxfuse
==> Creating Caskroom at /usr/local/Caskroom
==> We'll set permissions properly so we won't need sudo in the future.
Password:
==> Running installer for osxfuse; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
installer: Package name is FUSE for macOS
installer: choices changes file '/var/folders/s8/qf3lp34n08d_dftr7fhfvfcd52xrff/T/choices20180809-81835-1uipvkz.xml' applied
installer: Installing at base path /
installer: The install was successful.
==> Changing ownership of paths required by osxfuse; your password may be necessary
๐Ÿบ  osxfuse was successfully installed!

mc109472:~ mpreston1$ brew install s3fs

Updating Homebrew...
==> Installing dependencies for s3fs: libtasn1, gmp, nettle, libunistring, libffi, p11-kit, gnutls, libgpg-error, libgcrypt
==> Installing s3fs dependency: libtasn1
==> Downloading https://homebrew.bintray.com/bottles/libtasn1-4.13.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libtasn1-4.13.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libtasn1/4.13: 59 files, 435.2KB
==> Installing s3fs dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.1.2_2.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/08/087052cc1b49f5e0c42f5bd54f463f7fca7f7c73f00856c576706112bbe2a4c1?__gd
######################################################################## 100.0%
==> Pouring gmp-6.1.2_2.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/gmp/6.1.2_2: 18 files, 3.1MB
==> Installing s3fs dependency: nettle
==> Downloading https://homebrew.bintray.com/bottles/nettle-3.4.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/d0/d03831c4b2217900338b2316bf73b0074271b0007c2aaaa8fddf606a5f71d7ee?__gd
######################################################################## 100.0%
==> Pouring nettle-3.4.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/nettle/3.4: 85 files, 2MB
==> Installing s3fs dependency: libunistring
==> Downloading https://homebrew.bintray.com/bottles/libunistring-0.9.10.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/3a/3a7a0e8737c19995bc8a263724a90a26b418b177deee90b4e6746c353b348e12?__gd
######################################################################## 100.0%
==> Pouring libunistring-0.9.10.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libunistring/0.9.10: 54 files, 4.4MB
==> Installing s3fs dependency: libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libffi-3.2.1.sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/libffi/lib

==> Summary
๐Ÿบ  /usr/local/Cellar/libffi/3.2.1: 16 files, 297.0KB
==> Installing s3fs dependency: p11-kit
==> Downloading https://homebrew.bintray.com/bottles/p11-kit-0.23.12.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/bf/bff76ad09d7833cee05e6a2c36ccdf9882b7e30826087441f8b27481842dc0d2?__gd
######################################################################## 100.0%
==> Pouring p11-kit-0.23.12.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/p11-kit/0.23.12: 63 files, 2.9MB
==> Installing s3fs dependency: gnutls
==> Downloading https://homebrew.bintray.com/bottles/gnutls-3.5.19.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/fc/fcb6992abe7f180b1c92b36f4d462b6d4757204262091a70cef43fd0010070dd?__gd
######################################################################## 100.0%
==> Pouring gnutls-3.5.19.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/gnutls/3.5.19: 1,105 files, 7.7MB
==> Installing s3fs dependency: libgpg-error
==> Downloading https://homebrew.bintray.com/bottles/libgpg-error-1.32.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/32/32b74e2a574575de2bdbd26e55732169702de45f872a35790e371aa1fe15d4b0?__gd
######################################################################## 100.0%
==> Pouring libgpg-error-1.32.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libgpg-error/1.32: 25 files, 811.0KB
==> Installing s3fs dependency: libgcrypt
==> Downloading https://homebrew.bintray.com/bottles/libgcrypt-1.8.3.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e1/e10cc6cc1659cc9af6b165ce1e9c380f0f2b749a687fc221fb81494fee0ba579?__gd
######################################################################## 100.0%
==> Pouring libgcrypt-1.8.3.sierra.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/libgcrypt/1.8.3: 21 files, 2.6MB
==> Installing s3fs
==> Downloading https://homebrew.bintray.com/bottles/s3fs-1.84.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/9e/9e307d0ddd940c86fee609493f7b9d4539ee1949b8915eb34bc575249769df2f?__gd
######################################################################## 100.0%
==> Pouring s3fs-1.84.sierra.bottle.tar.gz
==> Caveats
Be aware that s3fs has some caveats concerning S3 "directories"
that have been created by other tools. See the following issue for
details:

  https://code.google.com/p/s3fs/issues/detail?id=73
==> Summary
๐Ÿบ  /usr/local/Cellar/s3fs/1.84: 8 files, 622.4KB
==> Caveats
==> libffi
This formula is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/libffi/lib

==> s3fs
Be aware that s3fs has some caveats concerning S3 "directories"
that have been created by other tools. See the following issue for
details:

  https://code.google.com/p/s3fs/issues/detail?id=73
mc109472:~ mpreston1$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment