[GH-ISSUE #2350] AWS credentials file searched is always the one in /root, not ${HOME} #1160

Open
opened 2026-03-04 01:51:49 +03:00 by kerem · 0 comments
Owner

Originally created by @poppem on GitHub (Oct 16, 2023).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2350

Additional Information

Version of s3fs being used (s3fs --version)

V1.90 (commit:unknown)

Version of fuse being used (pkg-config --modversion fuse, rpm -qi fuse or dpkg -s fuse)

Version: 2.9.9-5ubuntu3

Kernel information (uname -r)

5.15.0-79-generic

GNU/Linux Distribution, if applicable (cat /etc/os-release)

Ubuntu 22.04.3 LTS

How to run s3fs, if applicable

n/a

s3fs syslog messages (grep s3fs /var/log/syslog, journalctl | grep s3fs, or s3fs outputs)

Oct 16 19:15:15 mpoppe-head s3fs[3573919]: s3fs version 1.90(unknown) : s3fs -o createbucket -o instance_name=s3fs-bucket-test -o bucket=s3fs-bucket-test -o profile=badprofilename -o url=https://172.25.61.9:8111 -o use_path_request_style -o allow_other -o dbglevel=dbg -o curldbg /mnt/s3fs-bucket-test
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]s3fs_logger.cpp:LowSetLogLevel(240): change debug level from [CRT] to [DBG]
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]    PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755)
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]curl.cpp:InitMimeType(410): Try to load mime types from /etc/mime.types file.
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]curl.cpp:InitMimeType(415): The old mime types are cleared to load new mime types.
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]Loaded mime information from /etc/mime.types
Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]s3fs: Could not find profile: badprofilename in file: /root/.aws/credentials

Details about issue

As stated in the s3fs documentation, s3fs is supposed to look in ${HOME}/.aws/credentials for the profile, however, when a user mounts using sudo the credentials file searched is /root/.aws/credentials

mpoppe@mpoppe-head:/mnt$ sudo s3fs /mnt/s3fs-bucket-test -o createbucket -o instance_name=s3fs-bucket-test -o bucket=s3fs-bucket-test -o profile=badprofilename -o url=https://172.25.61.9:8111 -o use_path_request_style -o allow_other -o dbglevel=dbg -o curldbg
s3fs: Could not find profile: badprofilename in file: /root/.aws/credentials
mpoppe@mpoppe-head:/mnt$ echo $HOME
/nfs_home/mpoppe
Originally created by @poppem on GitHub (Oct 16, 2023). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2350 <!-- -------------------------------------------------------------------------- The following information is very important in order to help us to help you. Omission of the following details may delay your support request or receive no attention at all. Keep in mind that the commands we provide to retrieve information are oriented to GNU/Linux Distributions, so you could need to use others if you use s3fs on macOS or BSD. --------------------------------------------------------------------------- --> ### Additional Information #### Version of s3fs being used (`s3fs --version`) V1.90 (commit:unknown) #### Version of fuse being used (`pkg-config --modversion fuse`, `rpm -qi fuse` or `dpkg -s fuse`) Version: 2.9.9-5ubuntu3 #### Kernel information (`uname -r`) 5.15.0-79-generic #### GNU/Linux Distribution, if applicable (`cat /etc/os-release`) Ubuntu 22.04.3 LTS #### How to run s3fs, if applicable n/a #### s3fs syslog messages (`grep s3fs /var/log/syslog`, `journalctl | grep s3fs`, or `s3fs outputs`) <!-- if you execute s3fs with dbglevel, curldbg option, you can get detail debug messages. --> ``` Oct 16 19:15:15 mpoppe-head s3fs[3573919]: s3fs version 1.90(unknown) : s3fs -o createbucket -o instance_name=s3fs-bucket-test -o bucket=s3fs-bucket-test -o profile=badprofilename -o url=https://172.25.61.9:8111 -o use_path_request_style -o allow_other -o dbglevel=dbg -o curldbg /mnt/s3fs-bucket-test Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]s3fs_logger.cpp:LowSetLogLevel(240): change debug level from [CRT] to [DBG] Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test] PROC(uid=0, gid=0) - MountPoint(uid=0, gid=0, mode=40755) Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]curl.cpp:InitMimeType(410): Try to load mime types from /etc/mime.types file. Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]curl.cpp:InitMimeType(415): The old mime types are cleared to load new mime types. Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]Loaded mime information from /etc/mime.types Oct 16 19:15:15 mpoppe-head s3fs[3573919]: [s3fs-bucket-test]s3fs: Could not find profile: badprofilename in file: /root/.aws/credentials ``` ### Details about issue As stated in the s3fs documentation, s3fs is supposed to look in ${HOME}/.aws/credentials for the profile, however, when a user mounts using sudo the credentials file searched is /root/.aws/credentials ``` mpoppe@mpoppe-head:/mnt$ sudo s3fs /mnt/s3fs-bucket-test -o createbucket -o instance_name=s3fs-bucket-test -o bucket=s3fs-bucket-test -o profile=badprofilename -o url=https://172.25.61.9:8111 -o use_path_request_style -o allow_other -o dbglevel=dbg -o curldbg s3fs: Could not find profile: badprofilename in file: /root/.aws/credentials mpoppe@mpoppe-head:/mnt$ echo $HOME /nfs_home/mpoppe ```
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#1160
No description provided.