Here’s how to mount Linode S3-compatible Object Storage on Debian 12 (Bookworm), put the access key and secret on /var/app/secret/ and assign it to the user exampleuser.

Here’s how to mount Linode S3-compatible Object Storage on Debian 12 (Bookworm) and assign it to the user exampleuser:

1. Install Prerequisites

Update your system and install s3fs:

2. Set Up Credentials

Create a file to store the Linode S3 access keys securely. Use the /var/app/secret/credentials file as specified:

Replace:

  • LINODE_ACCESS_KEY with your Linode Access Key.
  • LINODE_SECRET_KEY with your Linode Secret Key.

3. Create a Mount Point

Create the directory where the object storage will be mounted:

4. Determine User and Group IDs

Find the UID and GID of the user exampleuser:

Example output:

Take note of the uid and gid (in this case, 1001).

5. Mount the Object Storage

Mount the S3 bucket and assign ownership to exampleuser. Replace BUCKET_NAME with your bucket’s name and <ENDPOINT> with your Linode Object Storage endpoint:

Example for a bucket named my-bucket:

6. Verify the Mount

Check the ownership and permissions of the mounted directory:

Expected output:

List the contents of the bucket:

7. Configure Auto-Mount on Boot

To automatically mount the S3 bucket on system reboot, add an entry to /etc/fstab:

Add the following line, replacing placeholders with your bucket and credentials:

Save and exit the file (Ctrl+O, Enter, Ctrl+X).

8. Test the Configuration

Reboot the system to ensure the auto-mount works:

After reboot, check the mount point:

Optional: Adjust Permissions

If you need specific file and directory permissions, you can add umask to the mount options. For example, to set 755 permissions for directories and files:

Your Linode S3-compatible Object Storage is now mounted and assigned to the user exampleuser.

Leave A Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.