the*_*btm 4 command-line centos mount cifs
我正在寻找一种方法来让 mount 命令提示输入密码,这样我的密码就不会出现在任何系统历史记录中,我以为我会让它read -s -p
在 mount 命令内运行命令,但我没有任何运气. 我想知道我的陈述是否错误以及如何错误。
mount -t cifs -o domain=domain.ad,user=thebtm,pass=$(read -s -p "password: ") "//NAS/thebtm$/" /mnt/cifsmount
password: mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud)
快速浏览手册页显示:
password=arg
specifies the CIFS password. If this option is not given then the
environment variable PASSWD is used. If the password is not
specified directly or indirectly via an argument to mount,
mount.cifs will prompt for a password, unless the guest option is
specified.
Run Code Online (Sandbox Code Playgroud)
因此,不要指定它,或者设置 PASSWD 环境变量。
小智 5
要强制 Centos 提示您输入密码,请安装以下软件包:
samba-client
cifs-utils
Run Code Online (Sandbox Code Playgroud)
您可以通过以 root 身份运行yum install samba-client cifs-utils
或使用sudo
.
归档时间: |
|
查看次数: |
7783 次 |
最近记录: |