AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 445347
Accepted
mahatmanich
mahatmanich
Asked: 2012-11-05 11:35:51 +0800 CST2012-11-05 11:35:51 +0800 CST 2012-11-05 11:35:51 +0800 CST

通过 fstab 使用凭据文件通过 cifs 安装 NAS 驱动器不起作用

  • 772

我可以通过以下方式安装驱动器,没问题:

mount -t cifs //nas/home /mnt/nas -o username=username,password=pass\!word,uid=1000,gid=100,rw,suid

但是,如果我尝试通过 fstab 挂载它,则会出现以下错误:

//nas/home /mnt/nas cifs  iocharset=utf8,credentials=/home/username/.smbcredentials,uid=1000,gid=100  0        0 auto

.smbcredentials 文件如下所示:

username=username
password=pass\!word

注意!在我的密码中......我在两种情况下都在逃避

:set noeol binary我还确保使用Mount CIFS Credentials File has Special Character的文件中没有 eol

chmod关于 .credentials 文件是0600并且chown是root:root文件在~/

为什么我进入一侧而不是 fstab?

我在 ubuntu 12 LTE 上运行,mount.cifs -V 给我 mount.cifs 版本:5.1

任何帮助和建议将不胜感激......

更新: /var/log/syslog显示以下

[26630.509396] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[26630.509407] CIFS VFS: Send error in SessSetup = -13
[26630.509528] CIFS VFS: cifs_mount failed w/return code = -13

更新 2

通过 fstab 使用 strace mount 进行调试:

strace -f -e trace=mount mount -a
Process 4984 attached
Process 4983 suspended
Process 4985 attached
Process 4984 suspended
Process 4984 resumed
Process 4985 detached
[pid  4984] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid  4984] mount("//nas/home", ".", "cifs", 0, "ip=<internal ip>,unc=\\\\nas\\home"...) = -1 EACCES (Permission denied)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Process 4983 resumed
Process 4984 detached

通过终端挂载

strace -f -e trace=mount mount -t cifs //nas/home /mnt/nas -o username=user,password=pass\!wd,uid=1000,gid=100,rw,suid
Process 4990 attached
Process 4989 suspended
Process 4991 attached
Process 4990 suspended
Process 4990 resumed
Process 4991 detached
[pid  4990] --- SIGCHLD (Child exited) @ 0 (0) ---
[pid  4990] mount("//nas/home", ".", "cifs", 0, "ip=<internal ip>,unc=\\\\nas\\home"...) = 0
Process 4989 resumed
Process 4990 detached
linux
  • 1 1 个回答
  • 8544 Views

1 个回答

  • Voted
  1. Best Answer
    mahatmanich
    2012-11-05T16:24:36+08:002012-11-05T16:24:36+08:00

    这是我错过的可变用户名的错字。正如您从 strace 调用中看到的那样,不知何故s丢失了:

     [pid 5240] getgid32() = 0 [pid 5240] access("/etc/smbcredentials", R_OK) = 0 [pid 5240]
     open("/etc/smbcredentials", O_RDONLY) = 3 
     [pid 5240] fstat64(3, {st_mode=S_IFREG|0777,st_size=41, ...}) = 0 
     [pid 5240] mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77d0000 
     [pid 5240] read(3, "uername=username\npassword=password"..., 4096) = 41 –
    
    • 1

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve