func getChecker() *ssh.HostKeyChecker { if !Flags.StrictHostKeyChecking { return nil } keyFile := ssh.NewHostKeyFile(Flags.KnownHostsFile) return ssh.NewHostKeyChecker(keyFile) }
// getChecker creates and returns a HostKeyChecker, or nil if any error is encountered func getChecker() *ssh.HostKeyChecker { if !globalFlags.StrictHostKeyChecking { return nil } keyFile := ssh.NewHostKeyFile(globalFlags.KnownHostsFile) return ssh.NewHostKeyChecker(keyFile, askToTrustHost, nil) }
// getChecker creates and returns a HostKeyChecker, or nil if any error is encountered func getChecker(config FleetConfig) *ssh.HostKeyChecker { if !config.StrictHostKeyChecking { return nil } keyFile := ssh.NewHostKeyFile(config.KnownHostsFile) return ssh.NewHostKeyChecker(keyFile) }
func getChecker() *ssh.HostKeyChecker { if !(*flagset.Lookup("strict-host-key-checking")).Value.(flag.Getter).Get().(bool) { return nil } knownHostsFile := (*flagset.Lookup("known-hosts-file")).Value.(flag.Getter).Get().(string) keyFile := ssh.NewHostKeyFile(knownHostsFile) return ssh.NewHostKeyChecker(keyFile, askToTrustHost, nil) }
// getChecker creates and returns a HostKeyChecker, or nil if any error is encountered func getChecker(cCmd *cobra.Command) *ssh.HostKeyChecker { strictHostKeyChecking, _ := cmdFleet.PersistentFlags().GetBool("strict-host-key-checking") if !strictHostKeyChecking { return nil } knownHostsFile, _ := cmdFleet.PersistentFlags().GetString("known-hosts-file") keyFile := ssh.NewHostKeyFile(knownHostsFile) return ssh.NewHostKeyChecker(keyFile) }