Disable Host Key Verification?

455 views
Skip to first unread message

Paul Houle

unread,
May 1, 2014, 5:57:54 PM5/1/14
to sshj-...@googlegroups.com
I'm trying to connect to an EC2 instance that I just spun up and don't know the host key.

How do I disable Host Key Verification?

ryanmg...@gmail.com

unread,
Jun 6, 2014, 5:20:05 PM6/6/14
to sshj-...@googlegroups.com
Ditto.

Basically need the equivalent of -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no to ignore known_hosts

Anybody?

ryanmg...@gmail.com

unread,
Jun 7, 2014, 2:20:19 AM6/7/14
to sshj-...@googlegroups.com

      ssh.addHostKeyVerifier(new HostKeyVerifier() {

        @Override

        public boolean verify(String arg0, int arg1, PublicKey arg2) {

          return true;

        }

      });

apparently works.

fifteen...@gmail.com

unread,
Jul 10, 2014, 5:22:32 AM7/10/14
to sshj-...@googlegroups.com
On Thursday, May 1, 2014 11:57:54 PM UTC+2, Paul Houle wrote:
I'm trying to connect to an EC2 instance that I just spun up and don't know the host key.

How do I disable Host Key Verification?

 sshClient.getTransport().addHostKeyVerifier(new PromiscuousVerifier());

Reply all
Reply to author
Forward
0 new messages