Class: Net::SSH::HostKeyMismatch

Class | Net::SSH::HostKeyMismatch
In: | lib/net/ssh/errors.rb
Parent: | Exception

Raised when the cached key for a particular host does not match the key given by the host, which can be indicative of a man-in-the-middle attack. When rescuing this exception, you can inspect the key fingerprint and, if you want to proceed anyway, simply call the remember_host! method on the exception, and then retry.

### Methods

[] fingerprint host ip key port remember_host!

### Public Instance methods

[](key)

An accessor for getting at the data that was used to look up the host (see also fingerprint, host, port, ip, and key).

fingerprint()

Returns the fingerprint of the key for the host, which either was not found or did not match.

host()

Returns the host name for the remote host, as reported by the socket.

ip()

Returns the IP address of the remote host, as reported by the socket.

key()

Returns the key itself, as reported by the remote host.

port()

Returns the port number for the remote host, as reported by the socket.

remember_host!()

Tell Net::SSH to record this host and key in the known hosts file, so that subsequent connections will remember them.

[Validate]