s3fs is a utility for Linux and macOS that allows you to mount cloud storage buckets via FUSE.
To install s3fs on Ubuntu, use the following command:
sudo apt install s3fs
It is recommended to use s3fs version 1.90 or higher.
To install the latest version of s3fs on Ubuntu, you can build it from source using these commands:
sudo apt install build-essential automake libcurl4-openssl-dev libxml2-dev pkg-config libssl-dev libfuse-dev git
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
./autogen.sh
./configure
make
sudo make install
For additional information and installation instructions on other operating systems, refer to the s3fs documentation.
To configure s3fs for use with the S3-compatible object storage, save the access key and secret key in the ~/.passwd-s3fs
file using the following command:
echo <Access Key>:<Secret Access Key> > ~/.passwd-s3fs
You can find the Access Key and Secret Access Key in your bucket settings under the S3 Parameters section.
Restrict access to the ~/.passwd-s3fs
file:
chmod 600 ~/.passwd-s3fs
To mount a bucket, choose a mount directory (in this example, /mnt/s3/
) and execute the following command, specifying the correct bucket name and directory path:
s3fs <bucket_name> /mnt/s3/ -o use_path_request_style -o url=https://s3.hostman.com -o passwd_file=~/.passwd-s3fs
To automatically mount the bucket at system startup, add the following line to the /etc/fstab file:
s3fs#<bucket_name> /mnt/s3 fuse _netdev,allow_other,use_path_request_style,url=https://s3.hostman.com,passwd_file=/root/.passwd-s3fs 0 0
For additional information on using s3fs, details on all parameters, and troubleshooting tips, consult the project's documentation, including the FAdocumentationQ section.