pkg

package module
v0.0.0-...-f2776db Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

SSH AGENT PROXY

Origin project ovm-ssh-agent

This project implements the same functionality as ovm-ssh-agent, and most code are the same.

This project has two working modes. One is ssh-agent, which implements the basic ssh-agent functions. You can use ssh-add to add and delete keys. In addition, ssh-agent can request the upstream ssh-agent's unix-socks and obtain keys from the upstream unix-socks for authentication.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHAgent

type SSHAgent struct {
	// agent server mode
	LocalAgent *localAgent
	// contains filtered or unexported fields
}

func NewSSHAgent

func NewSSHAgent(ctx context.Context) (*SSHAgent, error)

func (*SSHAgent) Add

func (s *SSHAgent) Add(key agent.AddedKey) error

Add only add private key into local agent

func (*SSHAgent) Close

func (s *SSHAgent) Close()

func (*SSHAgent) Extension

func (s *SSHAgent) Extension(extensionType string, contents []byte) ([]byte, error)

func (*SSHAgent) List

func (s *SSHAgent) List() ([]*agent.Key, error)

List return all keys from upstream and local agent

func (*SSHAgent) Lock

func (s *SSHAgent) Lock(passphrase []byte) error

Lock only lock local agent

func (*SSHAgent) Remove

func (s *SSHAgent) Remove(key ssh.PublicKey) error

Remove only remove key from local agent

func (*SSHAgent) RemoveAll

func (s *SSHAgent) RemoveAll() error

RemoveAll only remove all key from local agent

func (*SSHAgent) Serve

func (s *SSHAgent) Serve(listener net.Listener) error

func (*SSHAgent) Sign

func (s *SSHAgent) Sign(key ssh.PublicKey, data []byte) (*ssh.Signature, error)

func (*SSHAgent) SignWithFlags

func (s *SSHAgent) SignWithFlags(key ssh.PublicKey, data []byte, flags agent.SignatureFlags) (*ssh.Signature, error)

SignWithFlags generate signature a with public key from upstream and local agent

func (*SSHAgent) Signers

func (s *SSHAgent) Signers() (out []ssh.Signer, _ error)

Signers return all signers from upstream and local agent

func (*SSHAgent) Unlock

func (s *SSHAgent) Unlock(passphrase []byte) error

Unlock only unlock local agent

func (*SSHAgent) UsingLocalKeys

func (s *SSHAgent) UsingLocalKeys(keys ...string)

UsingLocalKeys load local keys from files

func (*SSHAgent) UsingUpstreamAgentSocks

func (s *SSHAgent) UsingUpstreamAgentSocks(socketFile string)

UsingUpstreamAgentSocks connect upstream ssh agent socks, current only support one upstream agent socks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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