Hi,
Using inspiration from the golang tmsh library GitHub - yukirii/go-tmsh: Golang wrapper library & CLI tool for BIG-IP Traffic Management Shell (TMSH). You just need to handle the keyboard interactions.
By creating challenge response struct and function.
type keyboardInteractive map[string]string
func (ki keyboardInteractive) Challenge(user, instruction string, questions []string, echos []bool) ([]string, error) {
var answers []string
for _, q := range questions {
answers = append(answers, ki[q])
}
return answers, nil
}
answers := keyboardInteractive(map[string]string{
"Password: ": "*****",
})
Then your config will look like so now
config := &ssh.ClientConfig{
User: "******",
Auth: []ssh.AuthMethod{
ssh.Password("*******"),
ssh.KeyboardInteractive(
answers.Challenge,
),
},
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}