当前位置: 首页>>代码示例>>Golang>>正文


Golang ssh.NewHostKeyFile函数代码示例

本文整理汇总了Golang中github.com/coreos/fleet/ssh.NewHostKeyFile函数的典型用法代码示例。如果您正苦于以下问题:Golang NewHostKeyFile函数的具体用法?Golang NewHostKeyFile怎么用?Golang NewHostKeyFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NewHostKeyFile函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: getChecker

func getChecker() *ssh.HostKeyChecker {
	if !Flags.StrictHostKeyChecking {
		return nil
	}
	keyFile := ssh.NewHostKeyFile(Flags.KnownHostsFile)
	return ssh.NewHostKeyChecker(keyFile)
}
开发者ID:tob1k,项目名称:deisctl,代码行数:7,代码来源:registry.go

示例2: getChecker

// 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)
}
开发者ID:rswart,项目名称:fleet,代码行数:9,代码来源:fleetctl.go

示例3: getChecker

// 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)
}
开发者ID:pulcy,项目名称:j2,代码行数:9,代码来源:fleet.go

示例4: getChecker

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)
}
开发者ID:nullstyle,项目名称:fleet,代码行数:9,代码来源:cmd.go

示例5: getChecker

// 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)
}
开发者ID:pulcy,项目名称:j2,代码行数:11,代码来源:fleetctl.go


注:本文中的github.com/coreos/fleet/ssh.NewHostKeyFile函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。