Update ssh.go

This commit is contained in:
影舞者 2021-06-09 11:32:59 +08:00 committed by GitHub
parent a9e78b6de3
commit d974523d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,7 @@ func SshConn(info *common.HostInfo, user string, pass string) (flag bool, err er
Host, Port, Username, Password := info.Host, info.Ports, user, pass
Auth := []ssh.AuthMethod{}
if info.SshKey != "" {
pemBytes, err := ioutil.ReadFile("shadow")
pemBytes, err := ioutil.ReadFile(info.SshKey)
if err != nil {
return false, errors.New("read key failed" + err.Error())
}