使用者
組
有效使用者
實際使用者
有效使用者ID
實際使用者ID
1 -- 使用者操作函數
linux-rwdx:~ # useradd --helpUsage: 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 versionValid services for --service are: files, ldap
添加一個使用者:
linux-rwdx:/home # useradd svn -d /home/svn -g svnlinux-rwdx:/home # passwd svnChanging password for svn.New Password: Reenter New Password: Password changed.mkdir /home/svnchown -R svn:svn /home/svn
2 -- 使用者組操作函數
linux-rwdx:~ # groupadd --helpUsage: groupadd [-D binddn] [-g gid [-o]] [-r] [-P path] [-p password] groupgroupadd - 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 versionValid services for --service are: files, ldap
http://wenku.baidu.com/view/37e58269561252d380eb6e0a.html