dcli command fails with "Unable to authenticate user." and does not prompt to re-enter credentials in vCenter Server
search cancel

dcli command fails with "Unable to authenticate user." and does not prompt to re-enter credentials in vCenter Server

book

Article ID: 412672

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

  • When running the dcli command as a user with insufficient permissions and saving the credentials, you can no longer re-enter the credentials.

    e.g.)
    root@vc [ ~ ]# dcli com vmware vcenter host list
    Username: [email protected]
    Password: **********
    Do you want to save credentials in the credstore? (y or n) [y]:y
    Error: Unable to authenticate user.
    Server error: com.vmware.vapi.std.errors.Unauthenticated
    Error message:
        Authentication required.

    root@vc [ ~ ]# dcli com vmware vcenter host list
    Error: Unable to authenticate user.
    Server error: com.vmware.vapi.std.errors.Unauthenticated
    Error message:
        Authentication required.



  • This article explains how to remove saved credentials.

Resolution

Steps to remove saved credentials

  1. Run the following command to list saved credentials:

    dcli +credstore-list

    example output:
    - type: vapi
      server: http://localhost/api
      session_manager: com.vmware.cis.session
      user: [email protected]

     

  2. Run the following command to remove the saved credentials:

    dcli +credstore-remove +server <server url> +username <user>

    example:
    dcli +credstore-remove +server http://localhost/api +username [email protected]