Another Network Tunnel; A simple program for local/remote port forwarding over a SSH tunnel.

Related tags

Miscellaneous ant-rs
Overview

🐜 ANT

Another Network Tunnel; A simple program for local/remote port forwarding over a SSH tunnel.

Recording

Table of Contents

Installation

(Back to top)

Pre-requisites

(Back to top)

This application was written in the Rust language. If you plan on compiling the application from source, you have to have the Rust toolchain installed. See Install Rust for more information.

For this application to work you have to have an openssh compatible client installed on your system and have it as the ssh command in your $PATH.

Linux

(Back to top)

Most Linux distributions ship an openssh client out of the box. If your Linux distribution does not ship a client, you may find the installation command below for your system.

Ubuntu/Debian

sudo apt install openssh-client

Arch

sudo pacman -S openssh

Fedora/RedHat

sudo dnf install openssh

OpenSUSE

sudo zypper in openssh-clients

MacOS

(Back to top)

Your Mac should have a version of ssh already installed, otherwise you can add openssh via the Homebrew package manager.

brew install openssh

Windows

(Back to top)

Since Windows 10 Microsoft ships a version of win32-openssh on your PC by default. If you want to install it nevertheless you can use the Scoop package manager. You can find futher information on SSH on Windows and Scoop here.

scoop install openssh

Pre-packaged Binary

(Back to top)

This application provides pre-packaged binaries for different architectures and Operating Systems under the Releases tab of GitHub.

Compilation

(Back to top)

To compile the programyou can use just scripts. You can append a cargo build flags as you wish, just the flag --release is set by default.

just b

To install the program you can use just install and then specify the installation package manager. For the installation targets deb and rpm sudo-privileges may be required on your system.

just install [cargo|deb|rpm]

Usage

(Back to top)

--------------------------------------------------
🐜 ANT 0.1.5 - Command Line Tool
--------------------------------------------------
Another Network Tunnel; A simple program for local/remote port forwarding over a SSH tunnel.

Usage: ant-rs [OPTIONS] <HOST>

Arguments:
  <HOST>  Host to create tunnel(s) for. Has to be in `hosts` inside your ANT configuration file.
          This host has to be accessible without user input. (use identity_file, etc. for
          authentication)

Options:
  -l, --log-level <LOG_LEVEL>  Log level of application [default: info]
  -c, --config <CONFIG>        Path to ANT configuration file `ant.yaml`
                               [default: ~/.ssh/ant.yaml]
  -d, --daemon                 Run application in daemon mode.
                               (will restart child process on child exit)
  -h, --help                   Print help
  -V, --version                Print version

Configuration

(Back to top)

The tunnels are configured via the ant.yaml file (by default at ~/.ssh/ant.yaml). An example file can be found in this repository at ./res/ant.example.yaml. The application uses the latest YAML standard to parse its configuration. Note that in the newest configuration only true|True|TRUE|false|False|FALSE are valid boolean values. y|yes|...|n|no|...|off|... will be read as String and may throw a hard error.

  • version
    Set the version of the program that should consume the configuration file. Major and minor version should match the used version of ant. If this version does not mtach the application will throw a hard error.
    Type: String
    Possible: 0.1

  • hosts
    Array that contains the hosts, each host is identified via a unique name (further $host) and contains the configuration of the connection to the host and the tunnels.
    Type: Host[ ]

  • hosts.$host
    Host entry and configuration. The host identification $host has to conform to default yaml key parameters.
    Type: Host (see hosts.$host.*)

  • hosts.$host.hostname
    Specifies the real host name to log into. IP or FQDN of server you want to connect to. IP's do not need explicit ". Do not specifiy port of server here (See hosts.$host.port).
    Type: String

  • hosts.$host.port (optional)
    Port of SSH service of server you want to connect to.
    Type: u16
    Default: 22

  • hosts.$host.identity_file
    Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA, Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read.
    Type: String

  • hosts.$host.user
    Specifies the user to log in as.
    Type: String

  • hosts.$host.local_forward
    Array of ports/addresses forwarded from the remote server to the local client. May be optional, if remote_forward is set.
    Type: Item[ ]
    Item:

    • local: String - IP/FQDN and port for client, where they should be accessible
    • remote: String - IP/FQDN and port for server, that should be forwarded
  • hosts.$host.remote_forward
    Array of ports/addresses forwarded from the local client to the remote server. May be optional, if local_forward is set.
    Type: Item[ ]
    Item:

    • local: String - IP/FQDN and port for client, that should be forwarded
    • remote: String - IP/FQDN and port for server, where they should be accessible
  • hosts.$host.ssh_options (optional)
    Additional SSH options that can be set for a specific host.
    Type: SshOptions (see hosts.$host.ssh_options.*)

  • hosts.$host.ssh_options.strict_host_key_checking (optional)
    If this option is set to yes, ssh will never automatically add host keys to the ~/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed. This provides maximum protection against man-in-the-middle (MITM) attacks, though it can be annoying when the /etc/ssh/ssh_known_hosts file is poorly maintained or when connections to new hosts are frequently made. This option forces the user to manually add all new hosts.
    If this option is set to accept-new then ssh will automatically add new host keys to the user's known_hosts file, but will not permit connections to hosts with changed host keys. If this option is set to no or off, ssh will automatically add new host keys to the user known hosts files and allow connections to hosts with changed hostkeys to proceed, subject to some restrictions.
    Type: String
    Default: yes
    Possible:

    • on, yes
    • off, no
    • accept-new
  • hosts.$host.ssh_options.bind_address (optional)
    Use the specified address on the local machine as the source address of the connection. Only useful on systems with more than one address.
    Type: String
    Default: null

  • hosts.$host.ssh_options.batch_mode (optional)
    If set to yes, user interaction such as password prompts and host key confirmation requests will be disabled. This option is useful in scripts and other batch jobs where no user is present to interact with ssh.
    Type: bool
    Default: true

  • hosts.$host.ssh_options.compression (optional)
    Specifies whether to use compression.
    Type: bool
    Default: false

  • hosts.$host.ssh_options.connect_timeout (optional)
    Specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default system TCP timeout. This timeout is applied both to establishing the connection and to performing the initial SSH protocol handshake and key exchange.
    Type: usize
    Default: 10

  • hosts.$host.ssh_options.server_alive_interval (optional)
    Sets a timeout interval in seconds after which if no data has been received from the server, ssh will send a message through the encrypted channel to request a response from the server.
    Type: usize
    Default: 600

  • hosts.$host.ssh_options.exit_on_forward_failure (optional)
    Specifies whether ssh should terminate the connection if it cannot set up all requested dynamic, tunnel, local, and remote port forwardings, (e.g. if either end is unable to bind and listen on a specified port).
    Type: bool
    Default: true

  • hosts.$host.ssh_options.ciphers (optional)
    Specifies the ciphers allowed and their order of preference. Multiple ciphers must be comma-separated. If the specified list begins with a + character, then the specified ciphers will be appended to the default set instead of replacing them. If the specified list begins with a - character, then the specified ciphers (including wildcards) will be removed from the default set instead of replacing them. If the specified list begins with a ^ character, then the specified ciphers will be placed at the head of the default set.
    The supported ciphers are:

    3des-cbc
    aes128-cbc
    aes192-cbc
    aes256-cbc
    aes128-ctr
    aes192-ctr
    aes256-ctr
    [email protected]
    [email protected]
    [email protected]
    

    The default set is:

    [email protected],aes128-ctr,aes192-ctr,aes256-ctr,
    [email protected],[email protected]
    

    Type: String
    Default: null

  • hosts.$host.ssh_options.macs (optional)
    Specifies the MAC (message authentication code) algorithms in order of preference. The MAC algorithm is used for data integrity protection. Multiple algorithms must be comma- separated. If the specified list begins with a + character, then the specified algorithms will be appended to the default set instead of replacing them. If the specified list begins with a - character, then the specified algorithms (including wildcards) will be removed from the default set instead of replacing them. If the specified list begins with a ^ character, then the specified algorithms will be placed at the head of the default set.
    The algorithms that contain -etm calculate the MAC after encryption (encrypt-then-mac). These are considered safer and their use recommended.
    The default is:

    Type: String
    Default: null

License

(Back to top)

ant, program for local/remote port forwarding over a SSH tunnel
Copyright (C) 2023, Hendrik Böck [email protected]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

See the file LICENSE for details.

You might also like...
A library to access BGPKIT Broker API and enable searching for BGP data archive files over time from public available data sources.
A library to access BGPKIT Broker API and enable searching for BGP data archive files over time from public available data sources.

BGPKIT Broker BGPKIT Broker is a online data API service that allows users to search for publicly available BGP archive files by time, collector, proj

 An iterator following a space-filling pattern over a given range
An iterator following a space-filling pattern over a given range

rlp-iter rlp-iter (Resolving Lattice Point Iterator) is an iterator that returns a space-filling permutation of integers in a given range. Specificall

Rustcat is a port listener that can be used for different purposes.
Rustcat is a port listener that can be used for different purposes.

⚙️ Rustcat ⚙️ -- Basic Netcat Alternative -- About Rustcat is a port listener that can be used for different purposes.

Gun port in rust & wasm

rusty-gun Rust & WASM port of Gun. Example (source) Use npm install rusty-gun import { Node as Gun } from "rusty-gun" const gun = new Gun('ws://localh

A port of dlmalloc to Rust.

dlmalloc-rs A port of dlmalloc to Rust. Documentation Why dlmalloc? This crate is a port of dlmalloc to Rust, and doesn't rely on C. The primary purpo

Rust library for program synthesis of string transformations from input-output examples 🔮

Synox implements program synthesis of string transformations from input-output examples. Perhaps the most well-known use of string program synthesis in end-user programs is the Flash Fill feature in Excel. These string transformations are learned from input-output examples.

osu-link is a program which links osu!stable beatmaps to osu!lazer's new store format, saving you disk space.

osu-link is a program which links osu!stable beatmaps to osu!lazer's new store format, saving you disk space.

Solana Escrow Program

Environment Setup Install Rust from https://rustup.rs/ Install Solana from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-to

A variation of the solana helloworld program example with a client written in Rust instead of Typescript

Simple Solana Smart Contract Example This repository demonstrates how to create and invoke a program on the Solana blockchain. In Solana the word prog

Comments
  • Bump serde_yaml from 0.9.21 to 0.9.22

    Bump serde_yaml from 0.9.21 to 0.9.22

    Bumps serde_yaml from 0.9.21 to 0.9.22.

    Release notes

    Sourced from serde_yaml's releases.

    0.9.22

    • Update indexmap dependency to version 2
    Commits
    • 060eb86 Release 0.9.22
    • b12ad38 Merge pull request #377 from dtolnay/indexmap
    • c418ad5 Update indexmap dependency to version 2
    • f1cd9e6 Remove .clippy.toml in favor of respecting rust-version from Cargo.toml
    • 147103c Show error details during miri setup in CI
    • 622553f Fix unused import warnings in test under cfg miri
    • 2037c7e Fix new unused_mut detected by nightly-2023-04-30
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump clap from 4.3.4 to 4.3.8

    Bump clap from 4.3.4 to 4.3.8

    Bumps clap from 4.3.4 to 4.3.8.

    Release notes

    Sourced from clap's releases.

    v4.3.8

    [4.3.8] - 2023-06-23

    Fixes

    • Error on ambiguity with infer_long_arg, rather than arbitrarily picking one, matching the documentation and subcommand's behavior

    v4.3.7

    [4.3.7] - 2023-06-23

    Documentation

    • Further clarify magic behavior in derive tutorial
    • Further clarify derive API's relationship to builder within the tutorial

    v4.3.6

    [4.3.6] - 2023-06-23

    Documentation

    • Suggest clio

    v4.3.5

    [4.3.5] - 2023-06-20

    • ColorChoice::possible_values is added to simplify things for builder users

    Fixes

    • ColorChoice::to_possible_value no longer includes descriptions, encouraging shorter help where possible
    Changelog

    Sourced from clap's changelog.

    [4.3.8] - 2023-06-23

    Fixes

    • Error on ambiguity with infer_long_arg, rather than arbitrarily picking one, matching the documentation and subcommand's behavior

    [4.3.7] - 2023-06-23

    Documentation

    • Further clarify magic behavior in derive tutorial
    • Further clarify derive API's relationship to builder within the tutorial

    [4.3.6] - 2023-06-23

    Documentation

    • Suggest clio

    [4.3.5] - 2023-06-20

    • ColorChoice::possible_values is added to simplify things for builder users

    Fixes

    • ColorChoice::to_possible_value no longer includes descriptions, encouraging shorter help where possible
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • format code with rustfmt

    format code with rustfmt

    Format code with rustfmt

    This commit fixes the style issues introduced in 7ddb4d8 according to the output from Rustfmt.

    Details: https://app.deepsource.com/gh/hendrikboeck/ant-rs/transform/9118cc56-b32b-4e63-bc21-eedd8e5e1f22/

    opened by deepsource-autofix[bot] 0
  • Bump clap from 4.3.3 to 4.3.4

    Bump clap from 4.3.3 to 4.3.4

    Bumps clap from 4.3.3 to 4.3.4.

    Release notes

    Sourced from clap's releases.

    v4.3.4

    [4.3.4] - 2023-06-14

    Features

    • Add Error::exit_code
    Changelog

    Sourced from clap's changelog.

    [4.3.4] - 2023-06-14

    Features

    • Add Error::exit_code
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
Releases(v0.1.6)
Owner
Hendrik Böck
Hendrik Böck
A simple telegram bot to get the tunnel info from ngrok.

Telegram Ngrok Bot A simple bot to fetch the running tunnels from ngrok api. Prerequisits Ngrok agent should be running. Configuration Ngrok config ve

Ishan Dongol 8 Feb 22, 2024
IR Remote Controller for WS2812(or analog) LED Strip

ir-smart-led-controller IR Remote Controller for WS2812(or analog) LED Strip. Resources Schematics Gerber files BOM License Licensed under either of A

Vitaly Domnikov 9 Dec 22, 2022
A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service

RustBot Bot is still under development and not ready for production use RustBot is a discord bot that executes whatever rust code you throw at it. In

Conner Bradley 7 Jan 3, 2022
Efficent platform for inference and serving local LLMs including an OpenAI compatible API server.

candle-vllm Efficient platform for inference and serving local LLMs including an OpenAI compatible API server. Features OpenAI compatible API server p

Eric Buehler 21 Nov 15, 2023
Yet another ROS2 client library written in Rust

RclRust Target CI Status Document Foxy (Ubuntu 20.04) Introduction This is yet another ROS2 client library written in Rust. I have implemented it inde

rclrust 42 Dec 1, 2022
Yet another multi-purpose discord bot

virus yet another multi-purpose discord bot

miten 2 Jan 11, 2022
🥳Yet another crate to create native nodejs addons :)

nodex Yet another crate to create native nodejs addons :) This crate aims to make creating native nodejs addons very easy and comfortable. It is in a

uuhan 4 Mar 29, 2022
sentry - yet another multi-purpose discord bot

sentry - yet another multi-purpose discord bot

miten 1 Feb 17, 2022
kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

kindly is a simple Rust implementation of a set-user-ID-root program, similar to sudo but in a much reduced way.

Vinícius Miguel 26 Dec 5, 2022
A clean and simple network looking glass application

lg lg is my custom Looking Glass server software for use in ZZANet. The whole application is lightweight, self-contained, and easy to use even outside

Evan Pratten 2 Dec 16, 2022