zoukankan      html  css  js  c++  java
  • su 和 sudo、su root和su root 区别

    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用户的主目录了。

  • 相关阅读:
    java面向对象(五)之多态
    java集合(list,set,map)
    jQuery基础
    Numpy详解
    Pandas详解一
    Linux 解压缩
    Linux 磁盘挂载
    Linux 磁盘管理
    su和sudo命令详解
    Linux查看文件命令
  • 原文地址:https://www.cnblogs.com/ljf181275034/p/2176704.html
Copyright © 2011-2022 走看看