Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x
4 - Create the file ~/.passwd-s3fs (one line file [accessKey:secretKey]
echo $ACCESS_KEY:$SECRET_KEY > ~/.passwd-s3fs
5 - Create the directory where the S3 bucket will be mounted
mkdir -p ~/.s3/archive.kuali.org
6 - Mount the bucket
s3fs archive.kuali.org ~/.s3/archive.kuali.org
@excalq

This comment has been minimized.

Copy link

commented Jun 30, 2016

Congrats on this being the first result on Google for "Mac s3fs"!

A couple updates to suggest:
#2 should now be: brew install homebrew/fuse/s3fs
#3 doesn't seem necessary anymore (at least on El Capitan)

After #4, issue the command chmod 600 ~/.passwd-s3fs to prevent a warning from s3fs.

@deepeeess

This comment has been minimized.

Copy link

commented Jul 7, 2016

The above instructions worked for me with OS X 10.11.5 with the one caveat that I also had to execute the following command, which required a reboot.

brew cask install osxfuse

If you are receiving mount_osxfusefs: failed to mount ~/.s3/mybucketname@/dev/osxfuse1: Socket is not connected message it is likely a permission problem. I would recommend using http://www.s3fox.net/ to isolate and debug permissions issues before attempting to mount with s3fs. A valid IAM access policy for an S3 bucket will look like this.

{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation"
            ],
            "Resource": "arn:aws:s3:::*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:DeleteObject",
                "s3:GetObject",
                "s3:PutObject",
                "s3:GetObjectAcl",
                "s3:PutObjectAcl"
            ],
            "Resource": "arn:aws:s3:::mybucketname/*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": "arn:aws:s3:::mybucketname"
        }
    ]
}

Also, FWIW the -d flag doesn't seem to work for the s3fs binary from brew.

@erudinsky

This comment has been minimized.

Copy link

commented Jul 27, 2016

Amazing staff guys! The only strange case, I have same bucket mounted to Mac and Linux (Linux is mounted via S3FS). The problem is that recently created folders by Linux users are locked down with red brick. Just curious why..

screen shot 2016-07-28 at 01 19 46

@lordpengwin

This comment has been minimized.

Copy link

commented Jan 25, 2017

Is there anyway to install this without using brew?

@ozbillwang

This comment has been minimized.

Copy link

commented Mar 1, 2017

use goofys (https://github.com/kahing/goofys) which you needn't manually set credentials.

@rawaby88

This comment has been minimized.

Copy link

commented Jan 22, 2018

can i use it for digital-ocean spaces? if yes where i can edit the server link
thank

@Darkflib

This comment has been minimized.

Copy link

commented Aug 9, 2018

@rawaby88 add the argument --url=https://nyc3.digitaloceanspaces.com

or any other region

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.