scp

package
v0.0.0-...-8f1a291 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 6 Imported by: 0

README

Pukcab module: SCP

Module name: scp

This module enables you tocopy any file from a remote host using SCP.

Requirements

  • SSH Host Key authentication must be used, password-based authentication is not supported
  • The scp binary must be present on the host running pukcab
  • The private key cannot be password protected
  • Only a single file can be downloaded

Configuration

Key Type Description
host_address string The host address or target server to connect to. Do not include a port number.
port number Optionally specify a port number. If omitted or set to 0, 22 is used.
username string The username to identify as to the remote host.
private_key string The private key in PEM format, including headers. Replace all newlines with \n.
host_public_key string The SSH public key of this host. Must include the algorithm. Example: ssh-rsa AAAAB3Nza....
file_path string The path of the file to download on the remote host.
scp_path string Optionally specify a SCP binary to use. If omitted pukcab will search $PATH.

Example

{
    "name": "scp",
    "config": {
        "host_address": "10.0.0.1",
        "port": 22,
        "username": "example",
        "private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\n<omitted>\n-----END OPENSSH PRIVATE KEY-----",
        "host_public_key": "ssh-ed25519 AAAAC3<omitted>",
        "file_path": "/config/config.boot"
    }
}

Documentation

Index

Constants

View Source
const Name = "scp"

Variables

This section is empty.

Functions

This section is empty.

Types

type SCPConfig

type SCPConfig struct {
	HostAddress   string `json:"host_address"`
	Port          uint16 `json:"port"`
	Username      string `json:"username"`
	PrivateKey    string `json:"private_key"`
	HostPublicKey string `json:"host_public_key"`
	FilePath      string `json:"file_path"`
	ScpPath       string `json:"scp_path"`
}

type SCPModule

type SCPModule struct{}

SCPModule the SCP pukcab module

func (SCPModule) Name

func (m SCPModule) Name() string

func (SCPModule) Run

func (m SCPModule) Run(c interface{}) ([]pukcab.File, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL