amazon-web-services - 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 但同样的问题。请帮忙。
解决方案
可能,如果对文件设置正确的权限不起作用,请尝试更改文件的所有者。运行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
你怎么看,所有者发生了变化,现在命令也将运行。
推荐阅读
- python - pycryptodome 模块不能作为轮子导入
- android - 如何有效地找出用户当前位置是否在一个经纬度点附近?
- html - 如何将多个值添加到角度的单个数据属性?
- python - python-sphinx 扩展,如何获取当前对象的名称?
- typeclass - Purescript 行联合
- listview - Xamarin.Forms ListView 中的交替项背景颜色
- c# - wsmprovhost.exe 在关闭 WsManConnectionInfo 后不终止
- amp-html - 向 amp-date-picker 模板添加其他内容
- c# - Gmail 未在 html 电子邮件中显示图像
- angular - 合并不同类型的 Observable