6.5

Table Of Contents
Authenticating Through vCenter Server and vCenter Single Sign-On
For all ESXi hosts that are managed by a vCenter Server system that is integrated with vCenter Single Sign-
On 6.0 and later, you can authenticate directly to the vCenter Server system, or you can authorize to
vCenter Server through vCenter Single Sign-On.
The best practice is to authenticate through vCenter Single Sign-On. The vCenter Single Sign-On service is
included in the Platform Services Controller. The Platform Services Controller can be embedded in your
vCenter Server installation, or one Platform Services Controller can handle authentication, certicate
management, and some other tasks for multiple vCenter Server systems.
N You cannot use this approach if vCenter Server is integrated with vCenter Single Sign-On 5.0.
You use the --psc option and, optionally, the --server option.
n
psc - Species the Platform Services Controller instance associated with the vCenter Server system that
manages the host.
n
server - Species the vCenter Server system that manages the host. Required if the Platform Services
Controller instance is associated with more than one vCenter Server system.
n
vihost - Species the ESXi host, as in earlier versions of vCLI.
Examples
vicfg-nics -l --username <sso_username> --password "<admin_pwd>" --server <vc_HOSTNAME_OR_IP> --
psc <psc_HOSTNAME_OR_IP> --vihost <esxi_HOSTNAME_OR_IP>
esxcli --server vc_HOSTNAME_OR_IP> --vihost <esxi_HOSTNAME_OR_IP> --username USERNAME> --
password <PASSWORD> --psc <psc_HOSTNAME_OR_IP> hardware clock get
If the specied user is known to vCenter Single Sign-On, a session is created. You can save the session with
the --savesessionfile argument, and later use that session with the --sessionfile argument. For example,
you can save the session by running the following command.
vicfg-nics -l --username sso_username> --password "<admin_pwd>" --server vc_HOSTNAME_OR_IP> --
psc <psc_HOSTNAME_OR_IP> --vihost <esxi_HOSTNAME_OR_IP>
Using a session le results in less overhead and beer performance than connecting to the Platform Services
Controller repeatedly.
Authenticating Directly to the Host
vCLI oers several options for authenticating directly to the host.
Create and Use a Session File
You can create a session le with the save_session script.
The save_session script is in the /apps/session directory of the vSphere SDK for Perl, which is included in
the vCLI package. You can use the session le, which does not reveal password information, when you run
vCLI commands. If the session le is not used for 30 minutes, it expires.
If you use a session le, other connection options are ignored.
Procedure
1 Connect to the directory where the script is located.
For example.
Getting Started with vSphere Command-Line Interfaces
34 VMware, Inc.