重新啟動時忽略 sshd 抑制劑

重新啟動時忽略 sshd 抑制劑

在我的家用電腦上,我將 sshd 設定為 SFTP 伺服器,以便我可以與朋友分享檔案。但是,當我嘗試重新啟動並且有人連接了 SFTP 用戶端時,我收到以下訊息:

$ reboot
User johndoe is logged in on sshd.
Please retry operation after closing inhibitors and logging out other users.
Alternatively, ignore inhibitors and users with 'systemctl reboot -i'.

儘管我可以按照指示執行sudo rebootreboot -i但這將忽略所有抑制劑。

是否可以僅忽略 ssh/sftp 登錄,或先停用 ssh 建立抑制劑?

答案1

阻止 SSH 關閉的是有人在積極使用它。您無法停止抑制,同時仍允許人們透過 SSH 登入。

如果您想覆蓋 SSH 阻止關閉,但仍讓作業系統檢查其他可能的抑制,您可以先手動關閉 SSH,然後繼續重新啟動:

systemctl stop sshd
reboot

因為SSH仍然是已啟用當機器再次啟動時它仍然會重新啟動。

相關內容