博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
su 和 sudo、su root和su - root 区别
阅读量:6905 次
发布时间:2019-06-27

本文共 736 字,大约阅读时间需要 2 分钟。

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

转载地址:http://flrdl.baihongyu.com/

你可能感兴趣的文章
GYM 101502I. Move Between Numbers
查看>>
Win10无法启动软件提示MSVCP110.dll丢失
查看>>
面向切面和面向对象的关系
查看>>
hdu 2032 杨辉三角
查看>>
Centos7安装python3和pip3
查看>>
spring集合类型注入
查看>>
EnumMap 两种使用方式的比较
查看>>
smarty课程---smarty3的安装和使用
查看>>
m_Orchestrate learning system---mo系统权限思考(如何实现以及注意什么)
查看>>
Dcloud课程8 开心一刻应用如何实现
查看>>
html5--2.9新的布局元素(5)-hgroup/address
查看>>
jar包和war包的介绍和区别
查看>>
jQuery.获取过滤点
查看>>
64位Windows系统下32位应用程序连接MySql
查看>>
js 类似发微博或者微信朋友圈的时间显示 刚刚 几天前
查看>>
Oracle10gr2 开机自启动脚本
查看>>
netty websocket
查看>>
SpringMVC单文件上传、多文件上传、文件列表显示、文件下载
查看>>
sql server T-SQL 基础
查看>>
private static
查看>>