-1
我正在嘗試設置允許用戶掛載CIFS共享的systemd服務。這是我的了:Systemd服務請求密碼
mount_cifs @。服務
[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 [email protected]
,我得到以下信息:
Password for [email protected]//remote/path:
Broadcast message from [email protected] (Wed 2016-10-26 21:24:56 CEST):
Password entry required for 'Password for [email protected]//remote/path:' (PID 5677).
Please enter password with the systemd-tty-ask-password-agent tool!
正是我怎麼用這個工具?
查詢systemd-tty-ask-password-agent工具的文檔後,您對如何使用它有什麼疑問? –
我已閱讀[文檔](https://www.freedesktop.org/software/systemd/man/systemd-tty-ask-password-agent.html),但我不明白我必須使用哪個命令提示用戶輸入密碼。鍵入'systemd-tty-ask-password-agent'(+選項)沒有太多... – gncs
您是否閱讀過[有關systemd和密碼提示的網絡相關問答](http://stackexchange.com/search ?q = systemd +密碼),特別是這個[systemd在啓動時提示輸入密碼](http://unix.stackexchange.com/questions/77769/prompt-for-password-during-boot-with-systemd-service ) –