rootfs常见文件格式解释

一、group -  user group file

        group是个文本文件,它包含了一个系统的用户组。

每行一条记录,并且每行有这样的格式:

              group_name:password:GID:user_list


字段描述如下:

       group_name  the name of the group. 组名

       password       the (encrypted) group password.  If this field is empty, no password is needed. 组密码

       GID                  the numeric group ID. 组ID,系统使用该ID号来识别该组

       user_list       a list of the usernames that are members of this group, separated by commas. 组内成员名字列表


二、passwd - 密码文件(摘自ubuntu12.04 man 5 passwd)


       Passwd   是个文本文件,   它包含了一个系统帐户列表,   给出每个帐户一些有用的信息,比如用户  ID,组  ID,  家目录, shell,等.  通常它也包含了每个用户经过加密的密码. 
 每行一条记录,并且每行有这样的格式:

              account:password:UID:GID:GECOS:directory:shell (帐号:密码:用户ID:组ID:一般的信息:目录:shell)


 字段描述如下:

              account      使用者在系统中的名字,它不能包含大写字母.

              password   加密的用户密码,或者星号。

              UID             用户 ID 数。

              GID             用户的主要组 ID 数。

              GECOS     这字段是可选的,通常为了存放信息目的而设的。通常,它包含了用户的全名.

              directory   用户的 $HOME 目录.

              shell         登录时运行的程序(如果空的,使用/bin/sh).     如果设为不存在的执行(程序),用户不能通过login(1) 登录.


三、shadow - 隐蔽的密码文件

       shadow is a file which contains the password information for the system's accounts and optional aging information.

       This file must not be readable by regular users if password security is to be maintained.

每行一条记录,每条记录包括9个字段,每个字段之间以":"隔开,格式如下:
        login name:encrypted password:date of last password change:minimum password age:maximum password age:password warning period:password inactivity period:account expiration date:reserved field


字段描述如下:

       login name
           It must be a valid account name, which exist on the system. 账号名称

       encrypted password
           Refer to crypt(3) for details on how this string is interpreted. 加密过的密码。如果该字段内容是"!",表示该账号不能用于登陆

           If the password field contains some string that is not a valid result of crypt(3), for instance ! or *,
           the user will not be able to use a unix password to log in (but the user may log in the system by other
           means).

           This field may be empty, in which case no passwords are required to authenticate as the specified login
           name. However, some applications which read the /etc/shadow file may decide not to permit any access at
           all if the password field is empty.

           A password field which starts with a exclamation mark means that the password is locked. The remaining
           characters on the line represent the password field before the password was locked.

       date of last password change
           The date of the last password change, expressed as the number of days since Jan 1, 1970. 上次修改密码的日期,该日期记录的是距离1970年1月1号的天数

           The value 0 has a special meaning, which is that the user should change her pasword the next time she will
           log in the system.

           An empty field means that password aging features are disabled.

       minimum password age
           The minimum password age is the number of days the user will have to wait before she will be allowed to
           change her password again. 该密码最少经过'minimum password age'天才允许用户修改

           An empty field and value 0 mean that there are no minimum password age.

       maximum password age
           The maximum password age is the number of days after which the user will have to change her password.在'maximum password age'天以后,系统会询问用户是否修改密码

           After this number of days is elapsed, the password may still be valid. The user should be asked to change
           her password the next time she will log in.

           An empty field means that there are no maximum password age, no password warning period, and no password
           inactivity period (see below).

           If the maximum password age is lower than the minimum password age, the user cannot change her password.

       password warning period

           The number of days before a password is going to expire (see the maximum password age above) during which the user should be warned.系统会在密码需要更改前'password warning period'天,提示用户更改密码

           An empty field and value 0 mean that there are no password warning period.

       password inactivity period

           The number of days after a password has expired (see the maximum password age above) during which the password should still be accepted (and the user should update her password during the next login). 密码失效日期 

           After expiration of the password and this expiration period is elapsed, no login is possible using the current user's password. The user should contact her administrator.

           An empty field means that there are no enforcement of an inactivity period.

       account expiration date
           The date of expiration of the account, expressed as the number of days since Jan 1, 1970. 账号失效日期,该日期记录的是自距离1970年1月1号的天数

           Note that an account expiration differs from a password expiration. In case of an acount expiration, the user shall not be allowed to login. In case of a password expiration, the user is not
           allowed to login using her password.

           An empty field means that the account will never expire.

           The value 0 should not be used as it is interpreted as either an account with no expiration, or as an expiration on Jan 1, 1970.

       reserved field
           This field is reserved for future use. 保留字段,暂时无用


四、fstab - 文件系统信息文件

       The  file  fstab  contains descriptive information about the various file systems.  fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this  file.
       Each  filesystem  is described on a separate line; fields on each line are separated by tabs or spaces.  Lines starting with '#' are comments, blank lines are ignored. The order of records in fstab  is  important  because
       fsck(8),  mount(8),  and  umount(8)  sequentially iterate through fstab doing their thing, though at boot time  mountall(8) may process the file out-of-order when it believes it is safe to do so.


每行一条记录,每一行的格式如下:
        fs_spec fs_file s_vfstype fs_mntopt
fs_freq fs_passno


       The first field (fs_spec).
              This field describes the block special device or remote filesystem to be mounted. 挂载设备的描述

       The second field (fs_file).
              This  field  describes  the  mount point for the filesystem.  For swap partitions, this field should be
              specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'. 挂载点(挂载点的完整路径)

       The third field (fs_vfstype).
              This field describes the type of the filesystem.  Linux supports lots  of  filesystem  types,  such  as
              adfs,  affs,  autofs,  coda, coherent, cramfs, devpts, efs, ext2, ext3, hfs, hpfs, iso9660, jfs, minix,
              msdos, ncpfs, nfs, ntfs, proc, qnx4, reiserfs, romfs, smbfs,  sysv,  tmpfs,  udf,  ufs,  umsdos,  vfat,
              xenix, xfs, and possibly others. For more details, see mount(8). 文件系统类型

       The fourth field (fs_mntops).

              This field describes the mount options associated with the filesystem. 挂载选项,一般填defaults

              It  is formatted as a comma separated list of options.  It contains at least the type of mount plus any
              additional options appropriate to the  filesystem  type.  For  documentation  on  the  available  mount
              options, see mount(8).  For documentation on the available swap options, see swapon(8).

              Basic file system independent options are:

              defaults
                     use default options: rw, suid, dev, exec, auto, nouser, and async.

              noauto do not mount when "mount -a" is given (e.g., at boot time)

              user   allow a user to mount

              owner  allow device owner to mount

              comment
                     for use by fstab-maintaining programs

              nofail do not report errors for this device if it does not exist.

       The fifth field (fs_freq).
              This  field is used for these filesystems by the dump(8) command to determine which filesystems need to
              be dumped.  If the fifth field is not present, a value of zero is returned and dump  will  assume  that
              the filesystem does not need to be dumped. 该文件系统是否需要备份,允许的值为0/1,0表示不需要备份,1表示需要备份

       The sixth field (fs_passno).
              This field is used by the fsck(8) program to determine the order in which filesystem checks are done at
              reboot time.  The root filesystem should be specified with a fs_passno  of  1,  and  other  filesystems
              should have a fs_passno of 2.  Filesystems within a drive will be checked sequentially, but filesystems
              on different drives will be checked at the same time to utilize parallelism available in the  hardware.
              If  the  sixth  field is not present or zero, a value of zero is returned and fsck will assume that the
              filesystem does not need to be checked. 该文件系统是否需要被检查,允许的值为0/1/2,0表示不需要检查,根文件系统如果需要检查则是1,其他文件系统如果需要被检查则是2


你可能感兴趣的:(Linux系统)