Created
February 2, 2019 19:47
-
-
Save mitjafelicijan/50bb1fe8090afe20a47e51d5bbc96bec to your computer and use it in GitHub Desktop.
Provision VM for S3 access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# replace IP with the ip of your newly created droplet | |
ssh root@IP | |
# this will install utilities for mounting storage objects as FUSE | |
apt install s3fs | |
# we now need to provide credentials (access key we created earlier) | |
# replace KEY and SECRET with your own credentials but leave the colon between them | |
# we also need to set proper permissions | |
echo "KEY:SECRET" > .passwd-s3fs | |
chmod 600 .passwd-s3fs | |
# now we mount space to our machine | |
# replace UNIQUE-NAME with the name you choose earlier | |
# if you choose different region for your space be careful about -ourl option (ams3) | |
s3fs UNIQUE-NAME /mnt/ -ourl=https://ams3.digitaloceanspaces.com -ouse_cache=/tmp | |
# now we try to create a file | |
# once you mount it may take a couple of seconds to retrieve data | |
echo "Hello cruel world" > /mnt/hello.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment