首页 > 解决方案 > s3fs 挂载错误:指定的 passwd_file 不可读

问题描述

我正在尝试在 linux ec2 实例上移植 ftp 服务器。/etc/passwd-s3fs 中存在密码验证文件,权限为 600。但是当我运行命令时:

$ s3fs bucketname /home/s3/s3mnt -o passwd_file=/etc/passwd-s3fs,nonempty

它显示以下错误:

s3fs: specified passwd_file is not readable.

也尝试使用权限 640 但同样的问题。请帮忙。

标签: amazon-web-servicesamazon-s3amazon-ec2s3fs

解决方案


可能,如果对文件设置正确的权限不起作用,请尝试更改文件的所有者。运行ls -la以查看谁是所有者:

total 224
drwx------ 8 ec2-user ec2-user    224 out 19 17:43 .
drwxr-xr-x 5 root     root         51 out 15 20:40 ..
drwxrwxr-x 2 ec2-user ec2-user     25 out 19 17:43 .aws
-rw------- 1 ec2-user ec2-user   1343 out 16 20:12 .bash_history
-rw-r--r-- 1 ec2-user ec2-user     18 jan 16  2020 .bash_logout
-rw-r--r-- 1 ec2-user ec2-user    193 jan 16  2020 .bash_profile
-rw-r--r-- 1 ec2-user ec2-user    231 jan 16  2020 .bashrc
drwx------ 4 ec2-user root         41 out 19 15:57 .cache
drwxrwxr-x 5 ec2-user ec2-user     87 out 19 17:16 images
-rw------- 1 root     root         62 out 19 17:29 .passwd-s3fs
drwxr-xr-x 5 ec2-user ec2-user   4096 out 19 16:45 s3fs-1.74
-rw-rw-r-- 1 ec2-user ec2-user 199120 jan 23  2016 s3fs-1.74.tar.gz
drwx------ 2 ec2-user ec2-user     29 out 15 20:40 .ssh
-rw------- 1 ec2-user ec2-user    989 out 19 17:43 .viminfo
drwxrwxr-x 4 ec2-user ec2-user     28 out 19 16:10 work

在我的情况下,passwd 文件归 root 所有,是什么导致权限被拒绝。更改文件所有者sudo chown ec2-user:ec2-user .passwd-s3fs,然后再次列出文件ls -la

total 224
drwx------ 8 ec2-user ec2-user    224 out 19 17:43 .
drwxr-xr-x 5 root     root         51 out 15 20:40 ..
drwxrwxr-x 2 ec2-user ec2-user     25 out 19 17:43 .aws
-rw------- 1 ec2-user ec2-user   1343 out 16 20:12 .bash_history
-rw-r--r-- 1 ec2-user ec2-user     18 jan 16  2020 .bash_logout
-rw-r--r-- 1 ec2-user ec2-user    193 jan 16  2020 .bash_profile
-rw-r--r-- 1 ec2-user ec2-user    231 jan 16  2020 .bashrc
drwx------ 4 ec2-user root         41 out 19 15:57 .cache
drwxrwxr-x 5 ec2-user ec2-user     87 out 19 17:16 images
-rw------- 1 ec2-user ec2-user     62 out 19 17:29 .passwd-s3fs
drwxr-xr-x 5 ec2-user ec2-user   4096 out 19 16:45 s3fs-1.74
-rw-rw-r-- 1 ec2-user ec2-user 199120 jan 23  2016 s3fs-1.74.tar.gz
drwx------ 2 ec2-user ec2-user     29 out 15 20:40 .ssh
-rw------- 1 ec2-user ec2-user    989 out 19 17:43 .viminfo
drwxrwxr-x 4 ec2-user ec2-user     28 out 19 16:10 work

你怎么看,所有者发生了变化,现在命令也将运行。


推荐阅读