class Train::Transports::Kerberos

A Transport which uses the SSH protocol to execute commands and transfer files while using gssapi-with-mic authentication

@author Fletcher Nichol <fnichol@nichol.ca>

Private Instance Methods

connection_options(opts) click to toggle source

Builds the hash of options needed by the Connection object on construction.

@param opts [Hash] merged configuration and mutable state data @return [Hash] hash of connection options @api private

# File lib/train/transports/kerberos.rb, line 58
def connection_options(opts)
  opts = {
    logger:                 logger,
    user_known_hosts_file:  '/dev/null',
    hostname:               opts[:host],
    port:                   opts[:port],
    username:               opts[:user],
    compression:            opts[:compression],
    compression_level:      opts[:compression_level],
    keepalive:              opts[:keepalive],
    keepalive_interval:     opts[:keepalive_interval],
    timeout:                opts[:connection_timeout],
    connection_retries:     opts[:connection_retries],
    connection_retry_sleep: opts[:connection_retry_sleep],
    max_wait_until_ready:   opts[:max_wait_until_ready],
    auth_methods:           %w[gssapi-with-mic],
    keys_only:              false,
    keys:                   opts[:key_files],
    password:               opts[:password],
    forward_agent:          opts[:forward_agent],
    transport_options:      opts,
  }

  opts[verify_host_key_option] = false

  opts
end
validate_options(options) click to toggle source
Calls superclass method
# File lib/train/transports/kerberos.rb, line 42
def validate_options(options)
  super(options)
  if options[:pty]
    logger.warn('[SSH] PTY requested: stderr will be merged into stdout')
  end

  super
  self
end
verify_host_key_option() click to toggle source

net-ssh >=4.2 has renamed paranoid option to verify_host_key

# File lib/train/transports/kerberos.rb, line 87
def verify_host_key_option
  current_net_ssh = Net::SSH::Version::CURRENT
  new_option_version = Net::SSH::Version[4, 2, 0]

  current_net_ssh >= new_option_version ? :verify_host_key : :paranoid
end