You can create a session file with the save_session script. The 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 file, which does not reveal password information, when you run vCLI commands. If the session file is not used for 30 minutes, it expires.
You can use the save_session.pl script or the
--savesessionfile option to the vCLI command. You must specify the server to connect to and the name of a session file in which the script saves an authentication cookie.
On Linux, you can set environment variables in a Linux bash profile or on the command line by using a command like the following:
See Using vCLI Commands in Scripts for an environment variable example.
The - -passthroughauth option, which is available if you run vCLI commands from a Microsoft Windows system, allows you to use the Microsoft Windows Security Support Provider Interface (SSPI). See the Microsoft Web site for a detailed discussion of SSPI.
You can use - -passthroughauth to establish a connection with a vCenter Server system. After the connection has been established, authentication for the vCenter Server system or any ESXi system it manages is no longer required. Using
- -passthroughauth passes the credentials of the user who runs the command to the target vCenter Server system. No additional authentication is required if the user who runs the command is known by the computer from which you access the vCenter Server system and by the computer running the vCenter Server software.
SSPI supports several protocols. By default, it selects the Negotiate protocol, where client and server try to find a protocol that both support. You can use
- -passthroughauthpackage to explicitly specify a protocol that is supported by SSPI. Kerberos, the Windows standard for domain-level authentication, is used frequently. If the vCenter Server system is configured to accept only a specific protocol, specifying the protocol with
- -passthroughauthpackage might be required for successful authentication. If you use
- -passthroughauth, you do not have to specify authentication information by using other options.