• 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

  • 相关阅读:
    Java 对象的内存布局(HotSpot 实现)
    HDFS 伪分布式环境搭建
    Java 多线程(四):锁(二)
    使用二叉树的递归套路来解决的问题
    乘积小于 K 的子数组
    Netty 学习(三):通信协议和编解码
    HDFS 分布式环境搭建
    Netty 学习(一):服务端启动 & 客户端启动
    累加和为 K 的最长子数组问题
    使用单调栈来解决的一些问题
  • 原文地址:https://www.cnblogs.com/motadou/p/2522633.html
Copyright © 2020-2023  润新知