使用者權限 - Linux

Table of Contents

系統 debian

如果要讓使用者可以執行關機動作時

可以安裝
# apt-get install sudo

執行 visudo

在以下新增
# User privilege specification
root ALL=(ALL) ALL
user ALL=(ALL) shutdown

之後該 user 登入後就能使用
sudo shutdown -h
再輸入 user 自己的密碼之後,系統就能關機。

那請問各位還有沒有其他方式可以新增一位使用者,
而這位使用者就只能做關機或是指定的動作呢?
更簡單的說就是這位 user 登入後,就能執行 shutdown -h 來做關機的動作。

感謝各位。

--

All Comments

Zora avatarZora2009-09-02
用group怎麼樣?
Yedda avatarYedda2009-09-06
使用group就可以了
Rosalind avatarRosalind2009-09-07
請問加到哪裡去?
Yedda avatarYedda2009-09-08
%群組名 ALL=(ALL) shutdown