Skip to content

Instantly share code, notes, and snippets.

@panamantis
Forked from korakot/s3_mount.md
Created August 3, 2020 22:37
Show Gist options
  • Save panamantis/b2bd06aa641f7e47309799d377388109 to your computer and use it in GitHub Desktop.
Save panamantis/b2bd06aa641f7e47309799d377388109 to your computer and use it in GitHub Desktop.

First, get your access and secret key from here

Then embed it in the colab notebook.

%%writefile ~/.passwd-s3fs
AWS_ACCESS_KEY_ID:AWS_SECRET_ACCESS_KEY

Need to restrict access

!chmod 600 ~/.passwd-s3fs

Then install S3 file system.

!apt install s3fs

Choose local path(/s3), and mount the bucket name (here it's thainlp)

!mkdir /s3         
!s3fs thainlp /s3

Now you can access S3 bucket as a directory

!ls /s3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment