class Net::SSH::Verifiers::AcceptNewOrLocalTunnel

file will not be helpful (in general).
connection is being tunnelled through a forwarded port, so the known-hosts
nonstandard port number. Those two conditions will typically mean the
verify a connection if the server is the localhost and the port is a
Basically the same as the AcceptNew verifier, but does not try to actually

def tunnelled?(args)

and the ip refers to the localhost.
A connection is potentially being tunnelled if the port is not 22,
def tunnelled?(args)
  return false if args[:session].port == Net::SSH::Transport::Session::DEFAULT_PORT
  ip = args[:session].peer[:ip]
  return ip == "127.0.0.1" || ip == "::1"
end

def verify(arguments)

returns true. Otherwise, performs the standard strict verification.
Tries to determine if the connection is being tunnelled, and if so,
def verify(arguments)
  return true if tunnelled?(arguments)
  super
end