Let a non-root user turn off computer# Linux - Linux 操作系统
B*s
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
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