sshkeys

package module
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 10 Imported by: 5

README

sshkeys

Actions Status Coverage Status PkgGoDev go-report

Get all ssh public keys of an ssh server.

Installation
go install github.com/Eun/sshkeys/cmd/sshkeys

OR

Prebuild from Releases

Usage
sshkeys [options] host

Options:
    -format=authorized_keys       Format to print the public keys, valid formats are: fingerprint, fingerprint-sha1, sha1, fingerprint-legacy, fingerprint-md5, md5, authorized_keys, authorizedkeys, authorized
    -output=console               Output format, valid formats are: console, json
    -timeout=60s                  Connection timeout
    -concurrent=4                 Concurrent workers
Example
sshkeys example.com
sshkeys -format=fingerprint-md5 -output=json example.com:22

Build History

Build history

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizedKey added in v1.13.4

func AuthorizedKey(key ssh.PublicKey) (string, error)

AuthorizedKey creates the authorized_key of the provided public key.

func DefaultKeyAlgorithms

func DefaultKeyAlgorithms() []string

DefaultKeyAlgorithms returns the default ssh key algorithms.

func FingerprintMD5 added in v1.13.4

func FingerprintMD5(key ssh.PublicKey) (string, error)

FingerprintMD5 creates the md5 fingerprint of the provided public key.

func FingerprintSHA1 added in v1.13.4

func FingerprintSHA1(key ssh.PublicKey) (string, error)

FingerprintSHA1 creates the sha1 fingerprint of the provided public key.

func FingerprintSHA256 added in v1.13.4

func FingerprintSHA256(key ssh.PublicKey) (string, error)

FingerprintSHA256 creates the sha256 fingerprint of the provided public key.

func GetKeys

func GetKeys(ctx context.Context, host string, concurrentWorkers int, algorithms ...string) (map[string]ssh.PublicKey, error)

GetKeys gets the public keys for a host. Specify the amount of concurrentWorkers and the algorithms that should be used to fetch the keys. If unsure use DefaultKeyAlgorithms.

func GetVersion

func GetVersion(ctx context.Context, host string) (string, error)

GetVersion returns the ssh version of the host.

Types

This section is empty.

Directories

Path Synopsis
cmd
sshkeys command

Jump to

Keyboard shortcuts

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