Go to main content

Managing User Accounts and User Environments in Oracle® Solaris 11.4

Exit Print View

Updated: August 2021
 
 

How to Add a User

  1. Become an administrator or a user with the User Management rights profile.

    See Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  2. Create a local user.
    # useradd -d dir -m [-S ldap] username -z no|yes|nodelegation
    –ddir

    Specifies the location of the home directory of the user. An optional server name can be added to the directory path, such as system1:/home/export/jdoe. The host information is written to auto_home and used by the automounter to mount the home directory.

    –m

    Creates a local home directory on the system for the user if the directory does not yet exist. However, if the –d option specifies a host that is remote, then the home directory is not created.

    If the directory does not yet exist, the home directory is created under the parent directory which is assumed as the the mount point of a ZFS dataset, such as export/home. The newly created directory is created as a multilevel dataset.

    –S ldap

    This option indicates that you are using LDAP and its repository for the account information. If you use LDAP, you can also assign default attributes by to the default@ user name which are applied to all users. For example:

    $ useradd -S -K user-attributes default@

    Multiple values can be specified for user-attributes and use the format key=value. These attributes are detailed in the user_attr(5) man page.

    For more information, see How to Assign Default User Attributes for LDAP Accounts.

    –z yes|no|nodelegation

    Specifies the default behavior of the useradd command when using the –z option.

    no

    Specifies that a new user account has a home directory that is a directory rather than a ZFS file system

    yes

    Specifies that a new user account has a home directory that is a ZFS file system with delegations specified by the zfs allow snapshot,mount,create command

    nodelegation

    Specifies that a new user account has a home directory that is a ZFS file system with no delegations

See Also

After creating a user, you might need to perform some additional tasks, including adding and assigning roles to a user, and displaying or changing the rights profiles of a user. For more information, see Creating a Role in Securing Users and Processes in Oracle Solaris 11.4.