# Authentication settings

By default, an iLO has only one user account: Administrator. But via the API you can create more users and manipulate them. It’s also possible to import SSH keys, configure kerberos settings and configure single-sign on. Some methods accept a lot of arguments, for details on what these arguments mean, I will refer to the ilo scripting guide.

class `hpilo.``Ilo`
  `get_all_users`()

    Get a list of all loginnames

        >>> ilo.get_all_users()
        ['Administrator']

  `get_all_user_info`()

    Get basic and authorization info of all users

        >>> ilo.get_all_user_info()
        {'Administrator': {'admin_priv': True,
                           'config_ilo_priv': True,
                           'remote_cons_priv': True,
                           'reset_server_priv': True,
                           'user_login': 'Administrator',
                           'user_name': 'Administrator',
                           'virtual_media_priv': True}}

  `get_user`(user_login)

    Get user info about a specific user

        >>> ilo.get_user(user_login='Administrator')
        {'admin_priv': True,
         'config_ilo_priv': True,
         'remote_cons_priv': True,
         'reset_server_priv': True,
         'user_login': 'Administrator',
         'user_name': 'Administrator',
         'virtual_media_priv': True}

  `add_user`(user_login, user_name, password, admin_priv=False, remote_cons_priv=True, reset_server_priv=False, virtual_media_priv=False, config_ilo_priv=True)

    Add a new user to the iLO interface with the specified name, password and permissions. Permission attributes should be boolean values.

  `mod_user`(user_login, user_name=None, password=None, admin_priv=None, remote_cons_priv=None, reset_server_priv=None, virtual_media_priv=None, config_ilo_priv=None)

    Set attributes for a user, only specified arguments will be changed. All arguments except user_name and password should be boolean

  `delete_user`(user_login)

    Delete the specified user from the ilo

  `import_ssh_key`(user_login, ssh_key)

    Imports an SSH key for the specified user. The value of ssh_key should be the content of an id_dsa.pub file

  `delete_ssh_key`(user_login)

    Delete a users SSH key

  `get_dir_config`()

    Get directory authentication configuration

        >>> ilo.get_dir_config()
        {'dir_authentication_enabled': False,
         'dir_enable_grp_acct': False,
         'dir_grpacct1_name': 'Administrators',
         'dir_grpacct1_priv': '1,2,3,4,5,6',
         'dir_grpacct1_sid': '',
         'dir_grpacct2_name': 'Authenticated Users',
         'dir_grpacct2_priv': 6,
         'dir_grpacct2_sid': 'S-1-5-11',
         'dir_kerberos_enabled': False,
         'dir_kerberos_kdc_address': '',
         'dir_kerberos_kdc_port': 88,
         'dir_kerberos_realm': '',
         'dir_local_user_acct': True,
         'dir_object_dn': '',
         'dir_server_address': '',
         'dir_server_port': 636,
         'dir_user_context_1': '',
         'dir_user_context_10': '',
         'dir_user_context_11': '',
         'dir_user_context_12': '',
         'dir_user_context_13': '',
         'dir_user_context_14': '',
         'dir_user_context_15': '',
         'dir_user_context_2': '',
         'dir_user_context_3': '',
         'dir_user_context_4': '',
         'dir_user_context_5': '',
         'dir_user_context_6': '',
         'dir_user_context_7': '',
         'dir_user_context_8': '',
         'dir_user_context_9': ''}

  `mod_dir_config`(dir_authentication_enabled=None, dir_local_user_acct=None, dir_server_address=None, dir_server_port=None, dir_object_dn=None, dir_object_password=None, dir_user_context_1=None, dir_user_context_2=None, dir_user_context_3=None, dir_user_context_4=None, dir_user_context_5=None, dir_user_context_6=None, dir_user_context_7=None, dir_user_context_8=None, dir_user_context_9=None, dir_user_context_10=None, dir_user_context_11=None, dir_user_context_12=None, dir_user_context_13=None, dir_user_context_14=None, dir_user_context_15=None, dir_enable_grp_acct=None, dir_kerberos_enabled=None, dir_kerberos_realm=None, dir_kerberos_kdc_address=None, dir_kerberos_kdc_port=None, dir_kerberos_keytab=None, dir_grpacct1_name=None, dir_grpacct1_sid=None, dir_grpacct1_priv=None, dir_grpacct2_name=None, dir_grpacct2_sid=None, dir_grpacct2_priv=None, dir_grpacct3_name=None, dir_grpacct3_sid=None, dir_grpacct3_priv=None, dir_grpacct4_name=None, dir_grpacct4_sid=None, dir_grpacct4_priv=None, dir_grpacct5_name=None, dir_grpacct5_sid=None, dir_grpacct5_priv=None, dir_grpacct6_name=None, dir_grpacct6_sid=None, dir_grpacct6_priv=None)

    Modify iLO directory configuration, only values that are specified will be changed.

  `get_sso_settings`()

    Get the HP SIM Single Sign-On settings

        >>> ilo.get_sso_settings()
        {'administrator_role': {'admin_priv': True,
                                'cfg_ilo_priv': True,
                                'login_priv': True,
                                'remote_cons_priv': True,
                                'reset_server_priv': True,
                                'virtual_media_priv': True},
         'operator_role': {'admin_priv': False,
                           'cfg_ilo_priv': False,
                           'login_priv': True,
                           'remote_cons_priv': True,
                           'reset_server_priv': True,
                           'virtual_media_priv': True},
         'trust_mode': 'DISABLED',
         'user_role': {'admin_priv': False,
                       'cfg_ilo_priv': False,
                       'login_priv': True,
                       'remote_cons_priv': False,
                       'reset_server_priv': False,
                       'virtual_media_priv': False}}

  `mod_sso_settings`(trust_mode=None, user_remote_cons_priv=None, user_reset_server_priv=None, user_virtual_media_priv=None, user_config_ilo_priv=None, user_admin_priv=None, operator_login_priv=None, operator_remote_cons_priv=None, operator_reset_server_priv=None, operator_virtual_media_priv=None, operator_config_ilo_priv=None, operator_admin_priv=None, administrator_login_priv=None, administrator_remote_cons_priv=None, administrator_reset_server_priv=None, administrator_virtual_media_priv=None, administrator_config_ilo_priv=None, administrator_admin_priv=None)
  `get_twofactor_settings`()

    Get two-factor authentication settings

        >>> ilo.get_twofactor_settings()
        {'auth_twofactor_enable': False,
         'cert_owner_subject': None,
         'cert_revocation_check': False}