how does permission works to run sbin command on mac..?

此生再无相见时 提交于 2019-12-20 05:59:18

问题


i'm using mac os x and i was trying to run shutdown command but it says i'm not a superuser.

However, i could run ifconfig without being super user.

Both command are in /sbin.

And my PATH environment variable include /sbin ( is that why i can run ifconfig..?).

From what i have found, it says that

/sbin

for scripts with superuser (root) privileges required.

But i'm not quite sure about this explanation..

I'd appreciate all your help..


回答1:


it means that you must be superuser (the owner of the machine) to run those commands, for example:

sudo shutdown 

it will ask for a password, you must type the main user's password (the typing will not print out the password's chars) and press enter so you can confirm you are the super user.

sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. more: http://ss64.com/bash/sudo.html



来源:https://stackoverflow.com/questions/24015023/how-does-permission-works-to-run-sbin-command-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!