Sun N1 System Manager 1.1 Administration Guide

Managing Users

You can set up new N1 System Manager users at any time. When you install the Sun N1 System Manager software, the management server's superuser (root) account has all three system default roles automatically added to it, and the Admin role is the account's default role.

The following table provides a quick reference to all the tasks and associated commands used to manage users.

Table 1–3 Managing Users Quick Reference

Task 

Command Syntax 

To Add an N1 System Manager User

# useradd -s
# n1sh create user user role role

To Delete an N1 System Manager User

# n1sh delete user user
# userdel

To Set a User's Default Role

set user user defaultrole defaultrole

To Show a User's Default Role

show user user

To Add a Role to a User

add user user role role

To Remove a Role From a User

remove user user role role

To List the Roles Added to a Specific User

show user user

For more information about these commands, see the Sun N1 System Manager 1.1 Command Line Reference Manual.

ProcedureTo Add an N1 System Manager User

Before You Begin

You must be superuser (root) to add a new user account to the management server's operating system. The rest of the task must be performed by a user with the SecurityAdmin role, such as the superuser account used in this task.

When you create a new user for the N1 System Manager, you can also configure the user's login shell to be either a UNIX® shell or the n1sh shell. If the user's login is configured with the n1sh shell, the user automatically logs into the n1sh shell (N1–ok> prompt) when logging in to the management server.

Steps
  1. Log in to the management server as superuser from a remote system.


    $ ssh -l root management-server
    

    See To Access the N1 System Manager Command Line for details.

  2. Add a new user account to the management server using the useradd command.

    Provide the following configuration details:

    • Use the useradd -s option to configure the user's shell to automatically log into the n1sh shell. For example: useradd -s /opt/sun/n1gc/bin/n1sh

    • Use the passwd command to set the user's password.

    • Add /opt/sun/n1gc/bin to the user's path in order to access the n1sh command.

    See the management server's useradd man page for more information.

  3. Add the user to the N1 System Manager with one or more roles.


    # n1sh -r SecurityAdmin create user user role role[,role...]

    The -r option enables you to run the n1sh command with the SecurityAdmin role, which is required for this step. See create user in Sun N1 System Manager 1.1 Command Line Reference Manual for details. You can also use the add user command to later add more roles.

ProcedureTo Delete an N1 System Manager User

Before You Begin

You must be superuser (root) to delete an existing user account from the management server's operating system. The rest of the task must be performed by a user with the SecurityAdmin role, such as the superuser account used in this task.

Steps
  1. Log in to the management server as superuser from a remote system.


    $ ssh -l root management-server
    

    See To Access the N1 System Manager Command Line for details.

  2. Delete the user from the N1 System Manager.


    # n1sh -r SecurityAdmin delete user user
    

    The -r option enables you to run the n1sh command with the SecurityAdmin role, which is required for this step. See delete user in Sun N1 System Manager 1.1 Command Line Reference Manual.

  3. (Optional) Delete the user account from the management server by using the management server's userdel command.

ProcedureTo Set a User's Default Role

Users are automatically logged in to the N1 System Manager with their default role.

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Show which roles are added to the user.


    N1-ok> show user user
    

    See show user in Sun N1 System Manager 1.1 Command Line Reference Manual for details.

  3. Set a user's default role.


    N1-ok> set user user defaultrole defaultrole
    

    See set user in Sun N1 System Manager 1.1 Command Line Reference Manual for details.


Example 1–2 Setting a User's Default Role

The following example shows setting the SecurityAdmin role as the default role for the root user.


N1-ok> show user root

Name:         root
Default Role: Admin
Roles:        SecurityAdmin, ReadOnly, Admin


N1-ok> set user root defaultrole SecurityAdmin

ProcedureTo Show a User's Default Role

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Show a user's default role.


    N1-ok> show user user
    

    See show user in Sun N1 System Manager 1.1 Command Line Reference Manual for details.


Example 1–3 Showing a User's Default Role

The following example shows that the root user has the Admin default role.


N1-ok> show user root

Name:         root
Default Role: Admin
Roles:        SecurityAdmin, ReadOnly, Admin

ProcedureTo Add a Role to a User

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Add one or more roles to a user.


    N1-ok> add user user role role[,role...]

    See add user in Sun N1 System Manager 1.1 Command Line Reference Manual for details. You can use the show role all command to list all of the valid roles.

ProcedureTo Remove a Role From a User

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. Remove one or more roles from a user.


    N1-ok> remove user user role role[,role...]

    See remove user in Sun N1 System Manager 1.1 Command Line Reference Manual for details. You can use the show user user command to list all the roles currently added to the user.

ProcedureTo List the Roles Added to a Specific User

Steps
  1. Log in to the N1 System Manager.

    See To Access the N1 System Manager Command Line for details.

  2. List the roles that are added to a user.


    N1-ok> show user user
    

    See show user in Sun N1 System Manager 1.1 Command Line Reference Manual for details.


Example 1–4 Listing the Roles that are Added to a Specific User

The following example shows that the root user currently has the SecurityAdmin, ReadOnly, and Admin roles.


N1-ok> show user root

Name:         root
Default Role: Admin
Roles:        SecurityAdmin, ReadOnly, Admin