Linux用户和组

用户

有效用户

实际用户

有效用户ID

实际用户ID

1 -- 用户操作函数
linux-rwdx:~ # useradd --help
Usage: useradd ...
useradd - create a new user

  -c comment     Set the GECOS field for the new account
 --show-defaults Print default values
 --save-defaults Save modified default values
  -D binddn      Use dn "binddn" to bind to the LDAP directory
  -d homedir     Home directory for the new user
  -e expire      Date on which the new account will be disabled
  -f inactive    Days after a password expires until account is disabled
  -G group,...   List of supplementary groups
  -g gid         Name/number of the users primary group
  -k skeldir     Specify an alternative skel directory
  -m             Create home directory for the new user
  -o             Allow duplicate (non-unique) UID
  -P path        Search passwd, shadow and group file in "path"
  -p password    Encrypted password as returned by crypt(3)
  -u uid         Force the new userid to be the given number
  -r, --system   Create a system account
  -s shell       Name of the user's login shell
 --service srv   Add account to nameservice 'srv'
      --help     Give this help list
      --usage    Give a short usage message
  -v, --version  Print program version
Valid services for --service are: files, ldap
添加一个用户:
linux-rwdx:/home # useradd svn -d /home/svn -g svn
linux-rwdx:/home # passwd svn
Changing password for svn.
New Password: 
Reenter New Password: 
Password changed.

mkdir /home/svn
chown -R svn:svn /home/svn
2 -- 用户组操作函数
linux-rwdx:~ # groupadd  --help
Usage: groupadd [-D binddn] [-g gid [-o]] [-r] [-P path] [-p password] group
groupadd - create a new group

  -D binddn      Use dn "binddn" to bind to the LDAP directory
  -g gid         Force the new groupid to be the given number
  -o             Allow duplicate (non-unique) UID
  -P path        Search passwd, shadow and group file in "path"
  -p password    Encrypted password as returned by crypt(3)
  -r, --system   Create a system account
 --service srv   Add account to nameservice 'srv'
      --help     Give this help list
      --usage    Give a short usage message
  -v, --version  Print program version
Valid services for --service are: files, ldap

 

 

 

 

 

 

 

 

http://wenku.baidu.com/view/37e58269561252d380eb6e0a.html

posted @ 2012-05-28 22:29  酱油和醋  阅读(347)  评论(0编辑  收藏  举报