权限如何工作在mac上运行sbin命令..? [英] how does permission works to run sbin command on mac..?

查看:298
本文介绍了权限如何工作在mac上运行sbin命令..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是mac os x,而我试图运行 shutdown 命令,但是它说
我不是超级用户。



然而,我可以运行 ifconfig 而不是超级用户。



这两个命令都在/ sbin 。

我的PATH环境变量include / sbin(这就是为什么我可以运行ifconfig ..?)。

从我发现的情况来看,对于具有超级用户的脚本来说,

  / sbin 

根)需要的权限。

但是我对这个解释不太确定。

我会很感激你的帮助。这意味着你必须是超级用户(所有者例如:

  sudo shutdown 

它将要求输入密码,您必须键入主要用户的密码(输入不会输出密码的字符),然后按回车键确认是超级用户。
$ b $ sudo允许允许的用户以超级用户或其他用户的身份执行一个命令,如sudoers文件中所指定的那样。更多: http://ss64.com/bash/sudo.html


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..

解决方案

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

这篇关于权限如何工作在mac上运行sbin命令..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆