[Boot/Shutdown] shutdown命令不用sudo?
Tofloor
poster avatar
wenhongxing
deepin
2022-01-17 17:59
Author

偶然发现deepin不需要sudo就能用shutdown重启或关机,感觉很方便但是不知道这样是否会有安全隐患?

Reply Favorite View the author
All Replies
deepin_12
deepin
2022-01-17 18:05
#1

在多用户系统中,关闭和重启系统会影响到所有已经登录的用户,因而执行此操作需要有root权限。不过,为方便个人应用,Linux桌面系统默认允许普通用户关闭和重启系统。

Reply View the author
zhangn1985
deepin
2022-01-18 01:17
#2

二楼的说法不准确,是Linux通过polkit使得普通用户在特定的策略下行使超级用户权限。

这种策略通常会允许用户通过logind执行关机/重启的工作,但Debian并没有配置shutdown也可以这样做,是Deepin的特例。

Reply View the author