【问题标题】:s3fs mount error: specified passwd_file is not readables3fs 挂载错误:指定的 passwd_file 不可读
【发布时间】:2020-05-13 11:10:20
【问题描述】:

我正在尝试在 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,但同样的问题。请帮忙。

【问题讨论】:

  • 我认为你需要使用passwd_file(下划线)而不是passwd-file(连字符)。
  • 对不起,更正我正在使用$ s3fs bucketname /home/s3/s3mnt -o passwd_file=/etc/passwd-s3fs,nonempty
  • 您可以尝试详细调试 -o dbglevel=info -f -o curldbg 还是尝试删除 nonempty
  • 你能运行 ls -l /etc/passwd-s3fs 吗?

标签: amazon-web-services amazon-s3 amazon-ec2 s3fs


【解决方案1】:

检查权限后 - 确保凭据文件使用正确的格式。

如果您使用的是~/.aws/credentials

[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

如果您使用其他凭据文件(即${HOME}/.passwd-s3fs):

ACCESS_KEY_ID:SECRET_ACCESS_KEY

来自here AUTHENTICATION 部分的其他信息:

   The  s3fs  password  file  has  this  format  (use this format if you have only one set of
   credentials):
       accessKeyId:secretAccessKey

   If you have more than one set of credentials, this syntax is also recognized:
       bucketName:accessKeyId:secretAccessKey

   Password files can be stored in two locations:
        /etc/passwd-s3fs     [0640]
        $HOME/.passwd-s3fs   [0600]

最后检查:确保您正在传递.passwd-s3fs 的绝对路径或从相对路径执行s3fs 命令。
我被困在上面而没有注意到路径。

【讨论】:

    【解决方案2】:

    可能,如果对文件设置正确的权限不起作用,请尝试更改文件的所有者。运行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
    

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

    【讨论】:

      【解决方案3】:

      运行以下命令

      sudo chmod 640 /etc/passwd-s3fs 
      

      并从命令行中删除“,非空”,它不是必需的。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-03
        • 1970-01-01
        • 2017-11-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多