^1640692625644
@
sname
user
slabel
用户及用户组
stype
thingDesc
sgroup
Linux常用命令.常用命令
sicon
icons/html.png
Sdescription
#$@text#$@
<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:18px"><strong>用户及用户组管理</strong></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">/etc/passwd &nbsp; &nbsp;存储用户账号</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">/etc/group &nbsp; &nbsp; &nbsp; 存储组账号</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">/etc/shadow &nbsp; &nbsp;存储用户账号的密码</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">/etc/gshadow &nbsp;存储用户组账号的密码</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">useradd 用户名</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">userdel 用户名</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">adduser 用户名</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">groupadd 组名</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">groupdel 组名</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">passwd root &nbsp; &nbsp; 给root设置密码</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">su root</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">su - root&nbsp;</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">/etc/profile &nbsp; &nbsp; 系统环境变量</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">bash_profile &nbsp; &nbsp; 用户环境变量</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">.bashrc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;用户环境变量</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">su user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;切换用户，加载配置文件.bashrc</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif; font-size:14px">su - user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;切换用户，加载配置文件/etc/profile ，加载bash_profile</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif"><strong>更改文件的用户及用户组</strong></span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif">sudo chown [-R] owner[:group] {File|Directory}</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif">例如：还以jdk-7u21-linux-i586.tar.gz为例。属于用户hadoop，组hadoop</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif">要想切换此文件所属的用户及组。可以使用命令。</span></p>

<p style="margin: 10px auto;"><span style="font-family:comic sans ms,sans-serif">sudo chown root:root&nbsp;jdk-7u21-linux-i586.tar.gz</span></p>
#$@text#$@
sdescriptors
xworker.lang.content.QuickContent
sinheritDescription
false
sth_createIndex
true
sth_registThing
command|xworker.jsch.JCtermRootWord
sth_registMyChilds
false
sth_registDisabled
false
sth_mark
false
