Class KnownHostsFileKeyVerificationStrategy

java.lang.Object
hudson.plugins.sshslaves.verifiers.SshHostKeyVerificationStrategy
hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy
All Implemented Interfaces:
Describable<SshHostKeyVerificationStrategy>

public class KnownHostsFileKeyVerificationStrategy extends SshHostKeyVerificationStrategy
A verifier that reads host keys from the Jenkins users' SSH known_hosts file.
Since:
1.13
Author:
Michael Clarke
  • Field Details

    • KNOWN_HOSTS_DEFAULT

      public static final String KNOWN_HOSTS_DEFAULT
    • KNOWN_HOSTS_PROPERTY

      public static final String KNOWN_HOSTS_PROPERTY
  • Constructor Details

    • KnownHostsFileKeyVerificationStrategy

      @DataBoundConstructor public KnownHostsFileKeyVerificationStrategy()
  • Method Details

    • verify

      public boolean verify(SlaveComputer computer, HostKey hostKey, TaskListener listener) throws Exception
      Description copied from class: SshHostKeyVerificationStrategy
      Check if the given key is valid for the host identifier.
      Specified by:
      verify in class SshHostKeyVerificationStrategy
      Parameters:
      computer - the computer this connection is being initiated for
      hostKey - the key that was transmitted by the remote host for the current connection. This is the key that should be checked to see if we trust it by the current verifier.
      listener - the connection listener to write any output log to
      Returns:
      whether the provided HostKey is trusted and the current connection can therefore continue.
      Throws:
      Exception
    • getPreferredKeyAlgorithms

      public String[] getPreferredKeyAlgorithms(SlaveComputer computer) throws IOException
      Description copied from class: SshHostKeyVerificationStrategy
      Provides a list of preferred key algorithms for this strategy and computer.
      Overrides:
      getPreferredKeyAlgorithms in class SshHostKeyVerificationStrategy
      Returns:
      a list of algorithms; empty or null lists will be ignored
      Throws:
      IOException
      See Also:
      • Connection.setServerHostKeyAlgorithms(java.lang.String[])
    • getKnownHostsFile

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public File getKnownHostsFile()