Linux(Centos) 用户切换su 与su – 区别

    Read

正确的切换方式:


正确的环境变量

不正确的切换方式:

不正确的环境变量

主要区别与用户的环境变量:

SourceByrd's Weblog-https://note.t4x.org/environment/centos-su-different/

已经切换到root,但是环境变量依然是byrd的环境变量。因此正确的切换root的用户方式为su - $users,而不是su $users,特别是$PATH,但是若是5.X系列,则区别非常明显。涉及到login-shell与non-login shell相关知识。
申明:本文由BYRD原创,参考了鸟哥教程(基于Centos6.4 X64),未经许可禁止转载!SourceByrd's Weblog-https://note.t4x.org/environment/centos-su-different/ SourceByrd's Weblog-https://note.t4x.org/environment/centos-su-different/

申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!
Byrd
  • by Published on March 29, 2014
  • 原文链接:https://note.t4x.org/environment/centos-su-different/
匿名

Comment

Anonymous

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: