【发布时间】:2017-03-09 07:33:50
【问题描述】:
我正在尝试设置允许用户挂载 CIFS 共享的 systemd 服务。这是我得到的:
mount_cifs@.service
[Unit]
Description=Mount CIFS share by %i
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /mnt/dir
ExecStart=/bin/mount -t cifs //remote/path /mnt/dir -o username=%i
ExecStop=/bin/umount /mnt/dir
ExecStopPost=/bin/rmdir /mnt/dir
但是,当我运行 systemctl start mount_cifs@gncs.service 时,我收到以下消息:
Password for gncs@//remote/path:
Broadcast message from root@ws (Wed 2016-10-26 21:24:56 CEST):
Password entry required for 'Password for gncs@//remote/path:' (PID 5677).
Please enter password with the systemd-tty-ask-password-agent tool!
我应该如何使用这个工具?
【问题讨论】:
-
在查阅了 systemd-tty-ask-password-agent 工具的文档后,您对如何使用它还有什么疑问?
-
我已经阅读了documentation,但我不明白我必须使用哪个命令来提示用户输入密码。输入
systemd-tty-ask-password-agent(+ 选项)并没有多大作用......