Startup

By running the following, you will gain an interactive interface of the shell. The LMIShell is waiting for the end of an input to quit – by hitting <ctrl+d> you can exit from it:

$ lmishell
> <ctrl+d>
$

or:

$ lmishell
> quit()
$

Establish a connection

Following examples demonstrate, how to connect to a CIMOM by issuing a connect() call.

Username/Password authentication

Common means of performing the authentication is done by providing a username and password to connect() function. See the following example:

> c = connect("host", "username")
password: # <not echoed>
>

or:

> c = connect("host", "username", "password")
>

Certificate authentication

LMIShell is capable of creating a connection by using a X509 certificate. For the purpose of creating a connection object, it is necessary to provide two file names, which contain a certificate and a private key.

See the following example:

> c = connect("host", key_file="key_file", cert_file="cert_file")
>

Unix socket

LMIShell can connect directly to the CIMOM using Unix socket. For this type of connection, the shell needs to be run under root user and the destination machine has to be either localhost, 127.0.0.1 or ::1. This type of connection is supported by TOG-Pegasus and there needs to be a Unix socket file present at /var/run/tog-pegasus/cimxml.socket. If the condition is not met, classic username/password method will be used.

See following example:

> c = connect("localhost")
>

Credentials validation

Function connect() returns either LMIConnection object, if provided credentials are OK, otherwise None is returned:

> # correct username or password
> c = connect("host", "username", "password")
> isinstance(c, LMIConnection)
True
> # wrong login username or password
> c = connect("host", "wrong_username", "wrong_password")
> c is None
True
>

Server’s certificate validation

When using https transport protocol, LMIShell tries to validate each server-side certificate against platform provided CA trust store. It is necessary to copy the server’s certificate from each CIMOM to the platform specific trust store directory.

NOTE: It is possible to make LMIShell skip the certificate validation process by lmishell -n or --noverify.

See following example:

$ lmishell --noverify
>

Table Of Contents

Previous topic

Structure

Next topic

Namespaces

This Page