由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - Let a non-root user turn off computer
相关主题
[已解决]请问怎么查看所有正在用机器的用户的IP地址?ubuntu 8.10 真tmd烦,搞半天都没找到root
问个基础问题,关于linux command存放地址请问关于root
ubuntu sudo PATH issue新警察求助 Ubuntu 8.10 下安装aMule 问题
/sbin/fdisk sda显示 fdisk: cannot open sda (转载)请教LINUX USERMOD命令 (转载)
如何只允许某个用户从某几台机器ssh进来?root 以外的用户有没有必要?
ubuntu有可能自动删除帐号吗?给不能用chrome的同学
在 Ubuntu 下如何关机?刚装了个ubuntu 10.10
一直没有搞定ppsfedora (14) root 用户没有声音
相关话题的讨论汇总
话题: root话题: privilege话题: non话题: computer话题: turn
进入Linux版参与讨论
1 (共1页)
B*********s
发帖数: 292
1
In Ubuntu Server, I can "sudo shutdown -h now" to turn off computer if I am
logged in as a root.
Now I need to do it in a non-root account. I don't want this account to have
root privilege, for security concern. But this account should be able to
turn off computer.
What should I do?
Last year I heard of one function, that root can generate one shell file
using root privilege, and give permission to non-root to run the shell
command with temporary root-privilege. But I forget what that function
e*n
发帖数: 1511
2
这个,
在一般的desktop上不都是non-root可以关机么?

am
have

【在 B*********s 的大作中提到】
: In Ubuntu Server, I can "sudo shutdown -h now" to turn off computer if I am
: logged in as a root.
: Now I need to do it in a non-root account. I don't want this account to have
: root privilege, for security concern. But this account should be able to
: turn off computer.
: What should I do?
: Last year I heard of one function, that root can generate one shell file
: using root privilege, and give permission to non-root to run the shell
: command with temporary root-privilege. But I forget what that function

Z**0
发帖数: 1119
3
可以在sudo里边加允许普通用户shutdown,no password。
自己看sudo.conf
B*********s
发帖数: 292
4
Thanks, Zer0. visudo and added one line:
user hostname = NOPASSWD: /sbin/shutdown
now the user(non-root) can sudo shutdown , but can't sudo anything else.
That is exactly what I want.
1 (共1页)
进入Linux版参与讨论
相关主题
fedora (14) root 用户没有声音如何只允许某个用户从某几台机器ssh进来?
完了,server要被我搞崩了ubuntu有可能自动删除帐号吗?
how to schedule a cron job without root?在 Ubuntu 下如何关机?
OK to install .rpm package without root account ?一直没有搞定pps
[已解决]请问怎么查看所有正在用机器的用户的IP地址?ubuntu 8.10 真tmd烦,搞半天都没找到root
问个基础问题,关于linux command存放地址请问关于root
ubuntu sudo PATH issue新警察求助 Ubuntu 8.10 下安装aMule 问题
/sbin/fdisk sda显示 fdisk: cannot open sda (转载)请教LINUX USERMOD命令 (转载)
相关话题的讨论汇总
话题: root话题: privilege话题: non话题: computer话题: turn