com.hp.ucmdb.discovery.library.clients.shell
Class SSHClient
java.lang.Object
com.hp.ucmdb.discovery.library.clients.BaseClient
com.hp.ucmdb.discovery.library.clients.shell.ShellClient
com.hp.ucmdb.discovery.library.clients.shell.SSHClient
public class SSHClient
- extends ShellClient
SSHclient
runs shell commands using SSH.
For a creation example, see ShellClient
.
Properties that can be redefined for SSHClient:
- external SSH library log level
To get more debug messages, set the external SSH library log level property
SSHAgent.SSH_LOG_LEVEL
. The log level is 1-7 where the debug level is 7.
The log messages appear on the console.
- Keyboard interactive prompts & responses
By default, the user\password are the only prompts identified. If Keyboard authentication was set with
a prompt other than user\password, you can set the prompts and responses with properties SSHAgent.PROMPTS
and SSHAgent.PROMPT_RESPONSES
. The property values are a java.util.List
of
java.util.String
. The prompts and responses are matched by index.
- All Protocol properties can be redefined when creating the client.
- See Also:
ShellClient
,
ClientFactory
,
com.hp.ucmdb.discovery.probe.clients.ClientsConsts
Constructor Summary |
SSHClient(ClientsFrameworkImpl framework,
java.util.Properties props)
|
Method Summary |
java.lang.String |
getKeyPath()
Returns the key file path from the protocol definition. |
int |
getPort()
Returns the port from the protocol definition. |
boolean |
supportsSudo()
|
Methods inherited from class com.hp.ucmdb.discovery.library.clients.shell.ShellClient |
canCopyFile, deleteFile, executeCmd, executeCmd, executeCmd, executeCmd, executeCmdWithTimeOut, getFile, getLastCommandOutputBytes, getMaxCommandLength, getServerPort, getWelcomeBuffer, putFile, setCharset, setMaxCommandLength |
Methods inherited from class com.hp.ucmdb.discovery.library.clients.BaseClient |
close, getClientType, getCredentialId, getIpAddress, getProperty, getShellCmdSeperator, getSudoCommands, getSudoPaths, getTimeout, getUserName, isConnected |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SSHClient
public SSHClient(ClientsFrameworkImpl framework,
java.util.Properties props)
throws java.lang.Exception
- Throws:
java.lang.Exception
getPort
public int getPort()
throws java.lang.Exception
- Returns the port from the protocol definition.
The port can be overidden in the properties at client creation.
- Returns:
- The SSH port for client connection
- Throws:
java.lang.Exception
- See Also:
ClientFactory
getKeyPath
public java.lang.String getKeyPath()
throws java.lang.Exception
- Returns the key file path from the protocol definition.
The path can be overidden in the properties at client creation.
- Returns:
- The path to the key file for secure connection
- Throws:
java.lang.Exception
- See Also:
ClientFactory
supportsSudo
public boolean supportsSudo()
- Overrides:
supportsSudo
in class BaseClient
Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.