Uniform interface for interacting with network hardware via telnet/ssh

jgivc/console

Go Report Card

This package provides a uniform interface for interacting with network hardware via telnet/ssh This package uses part of reiver/go-telnet package for handle telnet connection.

Usage

package main

import (
    "fmt"
    "log"

    "github.com/jgivc/console"
)

func main() {
    hosts := []console.Host{
        {
            Host:          "192.168.1.10",
            Port:          22,
            TransportType: console.TransportSSH,
            Account: console.Account{
                Username: "admin",
                Password: "pass",
            },
        },
        {
            Host:          "192.168.1.20",
            Port:          23,
            TransportType: console.TransportTELNET,
            Account: console.Account{
                Username: "admin",
                Password: "pass",
            },
        },
    }

    for _, h := range hosts {
        c := console.New()
        if err := c.Open(&h); err != nil {
            log.Fatal(err)
        }
        defer c.Close()

        if err := c.Run("term le 0"); err != nil {
            log.Fatal(err)
        }

        out, err := c.Execute("sh ver")
        if err != nil {
            log.Fatal(err)
        }

        fmt.Println(out)

        c.Sendln("q")
    }

}
Similar Resources

Golang interface for local/remote DRM CDM services (NO DRM IMPLEMENTATION HERE)

NO DRM IMPLEMENTATION HERE! ONLY ABSTRAT INTERFACE! What It's a generalized interface for different types of CDM for WEBDL use. A remote CDM JSON-RPC

Oct 24, 2022

Yet another Binance Smart Chain client based on TrustFi Network

TrustFi Smart Chain The goal of TrustFi Smart Chain is to bring programmability and interoperability to Binance Chain. In order to embrace the existin

Mar 27, 2021

Community-run technology powering the cryptocurrency, and decentralized applications on TrustFi Network

Go TrustFi-Ethereum Official Golang implementation of the TrustFi-Ethereum protocol. Automated builds are available for stable releases and the unstab

May 26, 2021

Split and distribute your private keys securely amongst untrusted network

Split and distribute your private keys securely amongst untrusted network

cocert An experimental tool for splitting and distributing your private keys safely* cocert, generates ECDSA - P521 key and uses a technique known as

Dec 5, 2022

LEO (Low Ethereum Orbit) is an Ethereum Portal Network client.

LEO LEO (Low Ethereum Orbit) is an Ethereum Portal Network client. What makes LEO different from other Portal Network clients is that it uses libp2p f

Apr 19, 2022

An implementation of the Filecoin Distributed Storage Network

An implementation of the Filecoin Distributed Storage Network

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

Oct 27, 2021

Avalanche: a network composed of multiple blockchains

Coreth and the C-Chain Avalanche is a network composed of multiple blockchains.

Dec 14, 2022

Practicing network programming using Go. These are some fundamental APIs

Go Networking This repository is a collection of Network Programming APIs or sim

Apr 29, 2022

XDC.Network Rosetta API Implementation

XDC.Network Rosetta API Implementation

Rosetta XDC.Network ROSETTA XDC.Network IS CONSIDERED ALPHA SOFTWARE. USE AT YOUR OWN RISK! COINBASE ASSUMES NO RESPONSIBILITY OR LIABILITY IF THERE I

Nov 28, 2022
Related tags
Thdl is a tool for easing the work with hardware description languages.
Thdl is a tool for easing the work with hardware description languages.

THDL Thdl is a tool for easing the work with hardware description languages. It is (and will always be) based solely on text processing, with no seman

Nov 17, 2022
:money_with_wings: CLI app for interacting with paymail service providers
:money_with_wings: CLI app for interacting with paymail service providers

Paymail Inspector CLI application for interacting with paymail service providers Table of Contents Installation Commands Documentation Examples & Test

Dec 14, 2022
Go-ethlibs - A sandbox of helpers related to interacting with Ethereum nodes

go-ethlibs: Go Ethereum Libraries A sandbox of helpers related to interacting wi

Jan 30, 2022
Concurrent ssh client

go-cs Concurrent ssh client cs is a program for concurrently executing local or remote commands on multiple hosts. It is using OpenSSH for running rem

Feb 21, 2022
🌰 encrypt/decrypt using ssh keys

ssh-vault ?? encrypt/decrypt using ssh private keys Documentation https://ssh-vault.com Usage $ ssh-vault -h Example: $ echo "secret" | ssh-vault -u

Dec 30, 2022
PKI support for SSH certificates

PKI certificates for SSH Introduction SSH certificates are limited in their usefulness - a certificate can only be signed with a single CA key, so no

Nov 1, 2022
Map ssh-ed25519 keys into x25519 keys

ssh-x22519 ========== The twisted Edwards curve used for ed25519 signatures is birationally equivalent to the Montgomery curve used for x25519: it is

Jan 4, 2023
🔐 Share end-to-end encrypted secrets with others via a one-time URL
🔐 Share end-to-end encrypted secrets with others via a one-time URL

If you use this repo, star it ✨ ?? Share end-to-end encrypted secrets with others via a one-time URL Use to securely share API Keys, Signing secrets,

Dec 26, 2022
🔐 Share end-to-end encrypted secrets with others via a one-time URL
🔐 Share end-to-end encrypted secrets with others via a one-time URL

If you use this repo, star it ✨ ?? Share end-to-end encrypted secrets with others via a one-time URL Use to securely share API Keys, Signing secrets,

Dec 26, 2022
Quoter - Get real-time Cryptocurrency quotes via CoinMarketCap

quoter Get real-time Cryptocurrency quotes via CoinMarketCap. Get it go get -u g

May 12, 2022