[GH-ISSUE #2031] Unable to mount s3 using user-data script #1023

Open
opened 2026-03-04 01:50:44 +03:00 by kerem · 1 comment
Owner

Originally created by @vivekmystrey on GitHub (Sep 9, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2031

Hi,

I am trying to mount an S3 bucket on EC2 Instance parsing below User-Data Script:

#!/bin/bash
sudo apt-get update -y
sudo apt-get install nfs-common git -y
sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config -y
git clone https://github.com/s3fs-fuse/s3fs-fuse.git
cd s3fs-fuse
sudo ./autogen.sh
sudo ./configure --prefix=/usr --with-openssl
sudo make
sudo make install

cd /home/ubuntu
echo *aws_access_key_id:aws_secret_access_key>> /home/ubuntu/.passwd-s3fs
chmod 600 /home/ubuntu/.passwd-s3fs
echo "Created Folder"
mkdir /home/ubuntu/dsmfs
echo "About to mount"
sudo s3fs <s3-bucket> <mount-path> -o passwd_file=/home/ubuntu/.passwd-s3fs -o nonempty -o uid=1000,gid=1000,umask=0277
echo "Mounting completed"

But, it is unable to mount an S3 bucket and could see the following results on Ec2 Instance:

ubuntu@ip-10-0-3-75:~$ ls -ltrs
ls: cannot access 'dsmfs': Permission denied
total 4
? d????????? ? ? ? ? ? dsmfs

And when I run the same script from the ssh client it works and the S3 bucket is mounted successfully?

Do, we need to parse any additional argument when mounting needs to be done non-interactively?

Originally created by @vivekmystrey on GitHub (Sep 9, 2022). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2031 Hi, I am trying to mount an S3 bucket on EC2 Instance parsing below User-Data Script: ``` #!/bin/bash sudo apt-get update -y sudo apt-get install nfs-common git -y sudo apt-get install automake autotools-dev fuse g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config -y git clone https://github.com/s3fs-fuse/s3fs-fuse.git cd s3fs-fuse sudo ./autogen.sh sudo ./configure --prefix=/usr --with-openssl sudo make sudo make install cd /home/ubuntu echo *aws_access_key_id:aws_secret_access_key>> /home/ubuntu/.passwd-s3fs chmod 600 /home/ubuntu/.passwd-s3fs echo "Created Folder" mkdir /home/ubuntu/dsmfs echo "About to mount" sudo s3fs <s3-bucket> <mount-path> -o passwd_file=/home/ubuntu/.passwd-s3fs -o nonempty -o uid=1000,gid=1000,umask=0277 echo "Mounting completed" ``` But, it is unable to mount an S3 bucket and could see the following results on Ec2 Instance: ubuntu@ip-10-0-3-75:~$ ls -ltrs ls: cannot access 'dsmfs': Permission denied total 4 ? d????????? ? ? ? ? ? dsmfs And when I run the same script from the ssh client it works and the S3 bucket is mounted successfully? Do, we need to parse any additional argument when mounting needs to be done non-interactively?
Author
Owner

@ggtakec commented on GitHub (Sep 24, 2022):

I think that the Network will be available before UserDataScript is called, so I think it has no problem to start s3fs in this phase.
But, it looks like you don't have access, as indicated by ls: cannot access "dsmfs": Permission denied you indicated.
You may need to set user_allow_other in /etc/fuse.conf.
Prepare this file and try it.
Thanks in advance for your assistance.

<!-- gh-comment-id:1256908298 --> @ggtakec commented on GitHub (Sep 24, 2022): I think that the Network will be available before UserDataScript is called, so I think it has no problem to start s3fs in this phase. But, it looks like you don't have access, as indicated by `ls: cannot access "dsmfs": Permission denied` you indicated. You may need to set `user_allow_other` in `/etc/fuse.conf`. Prepare this file and try it. Thanks in advance for your assistance.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1023
No description provided.