Documentation ¶
Index ¶
- func AgentAuths() ssh.AuthMethod
- type Remote
- func (r *Remote) ActiveUser() string
- func (r *Remote) As(user string)
- func (r *Remote) Close() error
- func (r *Remote) Get(filename string) ([]byte, error)
- func (r *Remote) Put(filename string, data []byte, perm os.FileMode) error
- func (r *Remote) Run(cmd string, stdin io.Reader) (sh.Result, error)
- func (r *Remote) String() string
- func (r *Remote) User() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentAuths ¶
func AgentAuths() ssh.AuthMethod
AgentAuths is a helper function to get SSH keys from an ssh agent. If any errors occur, an empty PublicKeys ssh.AuthMethod will be returned.
Types ¶
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote represents a Remote target, connected to over SSH
func New ¶
func New(addr string, user string, sudopass string, hostkeycallback ssh.HostKeyCallback, auths ...ssh.AuthMethod) (*Remote, error)
New returns a new Remote target from connection details
func (*Remote) ActiveUser ¶
ActiveUser returns the currently active user
func (*Remote) As ¶
As returns a new Remote that will use the same underlying connections, but all operations will be done as user.
No tests are done in this method. If user does not exist or does not have sudo rights, that will only be evident when trying to use methods on the returned object.
Click to show internal directories.
Click to hide internal directories.