# useradd -d dir -m [-S ldap] username
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.
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.
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.
For a detailed description of all of the options and arguments that you can specify with the useradd command, see the useradd(8) man page.
# passwd username New password: Type user password Re-enter new password: Retype password
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.