Class OpenSshConfig.Host
java.lang.Object
org.eclipse.jgit.transport.ssh.jsch.OpenSshConfig.Host
- Enclosing class:
- OpenSshConfig
Configuration of one "Host" block in the configuration file.
If returned from OpenSshConfig.lookup(String)
some or all of the
properties may not be populated. The properties which are not populated
should be defaulted by the caller.
When returned from OpenSshConfig.lookup(String)
any wildcard
entries which appear later in the configuration file will have been
already merged into this block.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Boolean
private com.jcraft.jsch.ConfigRepository.Config
(package private) int
private OpenSshConfigFile.HostEntry
(package private) String
(package private) File
(package private) int
(package private) String
(package private) String
(package private) String
-
Constructor Summary
ConstructorsConstructorDescriptionHost()
Creates a new uninitializedOpenSshConfig.Host
.Host
(OpenSshConfigFile.HostEntry entry, String hostName, String localUserName) -
Method Summary
-
Field Details
-
hostName
String hostName -
port
int port -
identityFile
File identityFile -
user
String user -
preferredAuthentications
String preferredAuthentications -
batchMode
Boolean batchMode -
strictHostKeyChecking
String strictHostKeyChecking -
connectionAttempts
int connectionAttempts -
entry
-
config
private com.jcraft.jsch.ConfigRepository.Config config -
KEY_MAP
-
-
Constructor Details
-
Host
public Host()Creates a new uninitializedOpenSshConfig.Host
. -
Host
Host(OpenSshConfigFile.HostEntry entry, String hostName, String localUserName)
-
-
Method Details
-
mapKey
-
getStrictHostKeyChecking
- Returns:
- the value StrictHostKeyChecking property, the valid values are "yes" (unknown hosts are not accepted), "no" (unknown hosts are always accepted), and "ask" (user should be asked before accepting the host)
-
getHostName
- Returns:
- the real IP address or host name to connect to; never null.
-
getPort
public int getPort()- Returns:
- the real port number to connect to; never 0.
-
getIdentityFile
- Returns:
- path of the private key file to use for authentication; null if the caller should use default authentication strategies.
-
getUser
- Returns:
- the real user name to connect as; never null.
-
getPreferredAuthentications
- Returns:
- the preferred authentication methods, separated by commas if more than one authentication method is preferred.
-
isBatchMode
public boolean isBatchMode()- Returns:
- true if batch (non-interactive) mode is preferred for this host connection.
-
getConnectionAttempts
public int getConnectionAttempts()- Returns:
- the number of tries (one per second) to connect before exiting. The argument must be an integer. This may be useful in scripts if the connection sometimes fails. The default is 1.
- Since:
- 3.4
-
complete
-
getConfig
public com.jcraft.jsch.ConfigRepository.Config getConfig()Get the ssh configuration- Returns:
- the ssh configuration
-
toString
-