/etc/passwd
man 5 passwd
查看文件的描述信息。
文件项:
name:password:UID:GID:GECOS:directory:shell
例如:
root:x:0:0:root:/root:/bin/bash
name
不能用大写字母password
加密表示 *
或者 x
,加密处理的密码通常存储到shadow当中。为空,则不需要密码登录。UID
:0,具有特权级权限,一般登录名为root
;
UID
可以有多条记录,多个用户名GID
:GECOS
注释:存放关于用户的描述性文字。directory
主目录,登陆后的初始路径。shell
一旦用户登录,则使用该程序控制。用户登录后,要启动一个进程,负责将用户的操作传给内核,这个进程是用户登录到系统后运行的命令解释器或某个特定的程序,即Shell。