linux – fstab和cifs挂载,可以在fstab之外存储身份验证信息吗?

我目前正在使用cifs在/ etc / fstab中安装一些网络共享(需要身份验证).它运行良好,但我想在fstab之外移动身份验证详细信息(用户名/密码)并能够chmod它600(因为如果我要更改其权限,fstab会有问题).我想知道是否可以这样做(多用户系统,不希望所有用户都能看到这些权限).

从:

//server/foo/bar /mnt/bar cifs username=user,password=pass,r 0 0

至:

//server/foo/bar /mnt/bar cifs <link to permissions>,r 0 0

(或类似的东西).谢谢.

解决方法

从mount.cifs联机帮助页:
credentials=filename
    specifies a file that contains a username and/or password. The format of the file is:

                         username=value
                         password=value
   This is preferred over having passwords in plaintext in a shared file,such as /etc/fstab. Be sure to protect any credentials file properly.

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...