From 7fab0aedef51130fe3b263960911b704b7a86b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=A1=E5=AE=9C=E5=B0=A7?= Date: Wed, 30 Aug 2017 10:54:05 +0800 Subject: [PATCH] bugfix see https://github.com/golang/go/issues/19767 --- .gitignore | 1 + ssh/ssh.go | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3cca9ee..30c48ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea .vscode bin/remote-tail* +yunsom.toml diff --git a/ssh/ssh.go b/ssh/ssh.go index 8ce6057..ca54fa0 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -2,10 +2,11 @@ package ssh import ( "fmt" - "golang.org/x/crypto/ssh" "io/ioutil" "os" "path/filepath" + + "golang.org/x/crypto/ssh" ) type Client struct { @@ -17,7 +18,10 @@ type Client struct { } func (this *Client) Connect() error { - conf := ssh.ClientConfig{User: this.User} + conf := ssh.ClientConfig{ + User: this.User, + HostKeyCallback: ssh.InsecureIgnoreHostKey(), + } if this.Password != "" { conf.Auth = append(conf.Auth, ssh.Password(this.Password))