Documentation ¶
Index ¶
- Constants
- Variables
- func GenSSHKey(path string) error
- func GetSSHKeyFromDb(mac *models.Instance, path string, isPriv bool) error
- func NewConfig(user string, auth *Auth) (*ssh.ClientConfig, error)
- type Auth
- type Client
- func (sshCli *Client) DisPassLogin() error
- func (sshCli *Client) GenerateSSHKey(instanceId string, path string) error
- func (client *Client) Run(command string) (Output, error)
- func (client *Client) RunWithAttempt(command string, maxAttempt int) (Output, error)
- func (sshCli *Client) StoreSSHKey(instanceId string) error
- type KeyPair
- type Output
Constants ¶
View Source
const SSH_AWS = "/go/src/weibo.com/opendcp/jupiter/conf/zhaowei9.pem"
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *ssh.ClientConfig Hostname string Port int }
func (*Client) GenerateSSHKey ¶
Generate SSH keypair based on path of the private key The public key would be generated to the same path with ".pub" added
func (*Client) RunWithAttempt ¶
func (*Client) StoreSSHKey ¶
type KeyPair ¶
func NewKeyPair ¶
Generate a new SSH keypair This will return a private & public key encoded as DER.
func (*KeyPair) Fingerprint ¶
Calculate the fingerprint of the public key
Click to show internal directories.
Click to hide internal directories.