您的位置:首页 > 其它

su 和 sudo、su root和su - root 区别

2011-09-14 22:17 253 查看
su - root:

just like login as root, then the shell is login
shell,
which mean it will expericene a login process,
usually
.bash_profile and .bashrc will be sourced

su root
like you open an
interactive shell in root name,
then only .bashrc will be sourced.

su 和 sudo 的区别:
1.共同点:都是root用户的权限;

2.不同点:su仅仅取得root权限,工作环境不变,还是在切换之前用户的工作环境;sudo是完全取得root的权限和root的工作环境。

su - root 和 su root(su)有什么区别?

su - root:表示人以root身份登录
just like login as root, then the
shell is login shell,
which mean it will expericene a login
process,
usually .bash_profile and .bashrc will be sourced
su
root:表示与root建立一个链接,通过root执行命令
like you open an interactive shell in root
name,
then only .bashrc will be
sourced.
最直接的区别就是su目录还是原先用户的目录
但是su或su - root后目录就变为root用户的主目录了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: