You can authenticate to vCenter Server by providing a user name and password.

You can provide credentials in different ways.

Specify the +username option.

dcli> vcenter vm list +username user42 +password mypass
Important

If you skip the +password option, you can provide the password in a more secure way when prompted. Providing the +password value explicitly presents a security risk.

Specify the DCLI_USERNAME environment variable.

export DCLI_USERNAME=user42 
dcli +server <vcenter_server_url> com vmware vcenter vm list

Provide credentials when prompted by DCLI.

Note

You are prompted for credentials if the operation requires authentication.

dcli> vcenter vm list 
Username: user42 
Password:  
Do you want to save credentials in the credstore? (y or n) [y]:

Save the credentials in the credential store.

Note

You must provide the command against which the authentication should be applied.

dcli +server <vcenter_server_url> +credstore-add +username user42 +password mypass com vmware vcenter vm list

After you save the user name and password in the credential store, you will not need to provide credentials each time you connect to vCenter Server.