Class OpenSSHConfig

java.lang.Object
com.jcraft.jsch.OpenSSHConfig
All Implemented Interfaces:
ConfigRepository

public class OpenSSHConfig
extends java.lang.Object
implements ConfigRepository
This class implements ConfigRepository interface, and parses OpenSSH's configuration file. The following keywords will be recognized,
  • Host
  • User
  • Hostname
  • Port
  • PreferredAuthentications
  • PubkeyAcceptedKeyTypes
  • FingerprintHash
  • IdentityFile
  • NumberOfPasswordPrompts
  • ConnectTimeout
  • HostKeyAlias
  • UserKnownHostsFile
  • KexAlgorithms
  • HostKeyAlgorithms
  • Ciphers
  • Macs
  • Compression
  • CompressionLevel
  • ForwardAgent
  • RequestTTY
  • ServerAliveInterval
  • LocalForward
  • RemoteForward
  • ClearAllForwardings
See Also:
ConfigRepository
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.jcraft.jsch.ConfigRepository

    ConfigRepository.Config
  • Field Summary

    Fields inherited from interface com.jcraft.jsch.ConfigRepository

    defaultConfig, nullConfig
  • Method Summary

    Modifier and Type Method Description
    ConfigRepository.Config getConfig​(java.lang.String host)  
    static OpenSSHConfig parse​(java.lang.String conf)
    Parses the given string, and returns an instance of ConfigRepository.
    static OpenSSHConfig parseFile​(java.lang.String file)
    Parses the given file, and returns an instance of ConfigRepository.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parse

      public static OpenSSHConfig parse​(java.lang.String conf) throws java.io.IOException
      Parses the given string, and returns an instance of ConfigRepository.
      Parameters:
      conf - string, which includes OpenSSH's config
      Returns:
      an instanceof OpenSSHConfig
      Throws:
      java.io.IOException
    • parseFile

      public static OpenSSHConfig parseFile​(java.lang.String file) throws java.io.IOException
      Parses the given file, and returns an instance of ConfigRepository.
      Parameters:
      file - OpenSSH's config file
      Returns:
      an instanceof OpenSSHConfig
      Throws:
      java.io.IOException
    • getConfig

      public ConfigRepository.Config getConfig​(java.lang.String host)
      Specified by:
      getConfig in interface ConfigRepository