我试过这个命令:
mount -t cifs //server/share/directory /mnt/directory -o credentials=/path/to/cifs.credentials --verbose
Run Code Online (Sandbox Code Playgroud)
回应是:
mount.cifs kernel mount options: ip=<IP of server>,unc=\\server \share,user=<username>,prefixpath=directory,pass=********
mount error(2): No such file or directory
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Run Code Online (Sandbox Code Playgroud)
但是,如果我在没有前缀路径的情况下尝试相同的命令:
mount -t cifs //server/share /mnt/directory -o credentials=/path/to/cifs.credentials --verbose
Run Code Online (Sandbox Code Playgroud)
它有效,我可以访问 /mnt/directory/directory。
如果我在选项中明确指定前缀路径,我会得到同样的错误,即:
mount -t cifs //server/share /mnt/directory -o credentials=/path/to/cifs.credentials,prefixpath=directory --verbose
Run Code Online (Sandbox Code Playgroud)
附加信息:
smbclient //server/share -U username -W domain -D directory
任何想法为什么前缀路径似乎会导致问题?最近这条路一直在起作用。我怀疑 Linux 端的软件包更新或 …
我正在查看/usr/lib/systemd/system/sshd.service
Fedora 25 机器上文件中的以下行:
ExecStart=/usr/sbin/sshd -D $OPTIONS
Run Code Online (Sandbox Code Playgroud)
我不确定$OPTIONS
从哪里来。它看起来像一个环境变量,尽管当我以这种方式设置 shell 变量时,它会被忽略,例如
# OPTIONS='-p 9999'
# systemctl start sshd
Run Code Online (Sandbox Code Playgroud)
我通读了 systemd.service 手册页的命令行部分,这表明可以通过Environment
一行设置环境变量:
Environment="ONE=one" 'TWO=two two'
Run Code Online (Sandbox Code Playgroud)
但是,那里没有设置这样的 OPTIONS 变量。
另外还有EnvironmentFile
一行,例如:
EnvironmentFile=-/etc/sysconfig/sshd
Run Code Online (Sandbox Code Playgroud)
$OPTIONS
那里也没有设置变量。$OPTIONS
指的是什么,它是如何设置的?