Skip to content

devsuccess101/ssh-config-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH Config Generator

Installation

Binary file

Please download the binary file from the release page.

For example:

wget https://github.com/devsuccess101/ssh-config-generator/releases/download/latest/ssh-config \
    && sudo chmod +x ssh-config \
    && sudo mv ssh-config /usr/local/bin
ssh-config --version

Build from source

git clone git@github.com:devsuccess101/ssh-config-generator.git
cargo build --release --bin ssh-config

The output file is ./target/release/ssh-config.

Usage

SSH Config Generator

Usage: ssh-config [OPTIONS] --user <USER> --host <HOST>

Options:
  -u, --user <USER>                    SSH user
  -h, --host <HOST>                    SSH hostname
  -i, --identity-file <IDENTITY_FILE>  Indentity file
  -o, --output <OUTPUT>                Output file
      --help                           Print help
  -V, --version                        Print version

Generate SSH Config

ssh-config -u user -i ~/.ssh/id_rsa -h 127.0.0.1 -h 127.0.0.2

Output:

# generated via `ssh-config` - SSH Config Generator:
Host node1
  Hostname 127.0.0.1
  User user
  Identity file /home/kimyvgy/.ssh/id_rsa
Host node2
  Hostname 127.0.0.2
  User user
  Identity file /home/kimyvgy/.ssh/id_rsa