Concurrent ssh-tail sessions and sink option

ssh-tail

This project is one of the problems that I generally face while debugging some system. When I am reproducing the issue on the machine i also want to tail the logs side-by-side to see the error. This becomes cumbersome when i need to fetch multiple log files or use them for future purpose or constantly hop between dashboards, script and machine for the session.

To solve this comes ssh-tail. It is a binary to tail log files from remote ssh machines and store them locally into your system for debugging or storage purpose. It is controlled by a JSON config which saves me time of creating multiple ssh-session either using a window managers or some bash script which does that for me. Logic for creating new filenames based on the unique flag.

It assumes that you have an unecrypted private key and present in your home folder inside an .ssh folder.

To use ssh-tail you need to set and env variable while running the process SSH_TAIL_CONFIG which will pick the json config to use for the ssh session.

Sinks

Sinks are the interfaces which will be used to dump the data fetched from the ssh session running on the remote machine. These sinks can be local file system or an external service like S3. For now the implementation is only made for the local file system but later S3 or any plugin can be included.

Usage

❯ SSH_TAIL_CONFIG="ssh_tunnel.json" make

Example cofig file:

{
  "host": "machine_ip",
  "port": int_port_number,
  "username": "username",
  "commands": [
    {
      "command": "command_1",
      "file": "file_1"
    },
    {
      "command": "command_2",
      "file": "file_2"
    }
    ...
  ]
}

Building locally

You can build the binary locally using the following command.

❯ make build

This will generate build files for targets (windows, linux and darwin).

Development / Contribution

This is just a binary that i created for myself to ease my workflow. In case you also face similar issues or want to solve some exisisting issue, feel free to dive right in and send a patch my way. I would be happy to review your patch.

To test out the changes locally you can use the following command.

❯ SSH_TAIL_CONFIG="ssh_tunnel.json" make
Owner
Yash Ladha
@nodejs Collaborator | GCI Mentor'18 @fossasia | GSoC'18 @fossasia | GCI Mentor'17 @fossasia @JBossOutreach
Yash Ladha
Similar Resources

concurrent recursive whois resolution

drwho - concurrent 'whois' queries given a set of ip addresses (v4 and v6), concurrently queries whois servers about them. example populate a file wit

Dec 28, 2021

A concurrent map with entries expiring after a specified interval.

go-ttlmap Go TTL Map is a concurent map with entries expiring after a specified interval. This package requires go1.14 or newer. Overview This impleme

Oct 13, 2021

Lightweight concurrent TCP framework for Golang

Knet TCP框架 基于Golang的轻量级并发TCP框架 中文文档 实例: server: package main import ( "fmt" "net" "time" "github.com/hxoreyer/knet" ) func main() { logger :=

Nov 5, 2022

tunnels to localhost and other ssh plumbing

remotemoe is a software daemon for exposing ad-hoc services to the internet without having to deal with the regular network stuff such as configuring VPNs, changing firewalls, or adding port forwards.

Dec 6, 2022

Simple and lightweight SSH git hosting with just a directory.

go-gitdir This project makes it incredibly easy to host a secure git server with a config that can be easily rolled back. It aims to solve a number of

Dec 20, 2022

scrapligo -- is a Go library focused on connecting to devices, specifically network devices (routers/switches/firewalls/etc.) via SSH and NETCONF.

scrapligo -- is a Go library focused on connecting to devices, specifically network devices (routers/switches/firewalls/etc.) via SSH and NETCONF.

scrapligo -- scrap(e c)li (but in go!) -- is a Go library focused on connecting to devices, specifically network devices (routers/switches/firewalls/etc.) via SSH and NETCONF.

Jan 4, 2023

LazySSH is an SSH server that acts as a jump host only, and dynamically starts temporary virtual machines.

LazySSH is an SSH server that acts as a jump host only, and dynamically starts temporary virtual machines. If you find yourself briefly starti

Dec 11, 2022

mysshw - a free and open source ssh cli client soft.

mysshw install go version = 1.16.* use go get go get -u github.com/cnphpbb/mysshw go version = 1.17.* use go install go install github.com/cnphpbb/

Dec 16, 2021

IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

IRC bot for launch ddos attack, Mainly of scan target are IoT device that run linux and open default SSH port

Nov 10, 2021
Hedged Go GRPC client which helps to reduce tail latency at scale.

hedgedgrpc Hedged Go GRPC client which helps to reduce tail latency at scale. Rationale See paper Tail at Scale by Jeffrey Dean, Luiz André Barroso. I

Dec 16, 2022
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀

Golang SSH Client. Fast and easy golang ssh client module. Goph is a lightweight Go SSH client focusing on simplicity! Installation ❘ Features ❘ Usage

Dec 24, 2022
Extended ssh-agent which supports git commit signing over ssh

ssh-agentx ssh-agentx Rationale Requirements Configuration ssh-agentx Configuration ssh-gpg-signer Linux Windows Signing commits after configuration T

Jun 29, 2022
Golang `net/rpc` over SSH using installed SSH program

Golang net/rpc over SSH using installed SSH program This package implements a helper functions to launch an RPC client and server. It uses the install

Nov 16, 2022
Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Sep 8, 2022
one simple git ssh server (just for learning git over ssh )

wriet one simple git ssh server use golang write one simple git ssh server how to running starting service docker-compose up -d add authorized_keys i

Mar 5, 2022
concurrent caching proxy and decoder library for collections of PMTiles

go-pmtiles A caching proxy for the serverless PMTiles archive format. Resolves several of the limitations of PMTiles by running a minimalistic, single

Jan 2, 2023
A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection.
A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection.

aScan A high-performance concurrent scanner written by go, which can be used for survival detection, tcp port detection, and web service detection. Fu

Aug 15, 2022
A quick and dirty concurrent Golang-based port scanner

go-scan-ports A quick and dirty concurrent Golang-based port scanner, this will scan ports 1 through 1024 Usage: Requires 1 command line argument of U

Jan 6, 2022
Concurrent download manager built in Go
Concurrent download manager built in Go

Golang Download Manager - Weekend Project A concurrent download manager written in pure Go without any dependency. I wrote this code for my YouTube vi

Sep 29, 2022