Go to main content

Managing User Accounts and User Environments in Oracle® Solaris 11.4

Exit Print View

Updated: August 2021

How to Delete a User

  1. Become an administrator.
    $ su -

    Note -  This method works whether root is a user account or a role.
  2. Archive the home directory of the user.
  3. Delete the user.

    Use one of the following commands:

    • Use the useradm command.
      $ useradm delete [-S [files | ldap]] username
    • Use the userdel command.
      $ userdel -r username

      The –r option removes the account from the system.

      The preferred method for removing a local home directory for a deleted user is to specify the –r option with the userdel command. This method is preferred because user home directories are now ZFS datasets. If the user's home directory is on a remote server, manually delete it:

      $ userdel username

      For a full list of command options, see the userdel(8) man page.

  4. Confirm if the user account has been deleted.
    $ useradm list [-S [files | ldap]] username

Next Steps

Additional cleanup might be required if the user that you deleted had administrative responsibilities, for example creating cron jobs, or if the user had additional accounts in non-global zones.