Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniellockyer/sshh
🖥️ Quickly SSH into hosts
https://github.com/daniellockyer/sshh
ssh tools
Last synced: 8 days ago
JSON representation
🖥️ Quickly SSH into hosts
- Host: GitHub
- URL: https://github.com/daniellockyer/sshh
- Owner: daniellockyer
- License: mit
- Created: 2019-11-25T03:40:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-04T11:04:49.000Z (almost 4 years ago)
- Last Synced: 2024-10-13T07:05:17.911Z (23 days ago)
- Topics: ssh, tools
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 19
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🖥️ sshh
_(aka `ssh hosts`)_ - Quickly SSH into hosts
[![Actions Status](https://github.com/daniellockyer/sshh/workflows/CI/badge.svg)](https://github.com/daniellockyer/sshh/actions)
[![Crates.io](https://img.shields.io/crates/v/sshh.svg)](https://crates.io/crates/sshh)Problem:
* dozens of hosts to SSH in to but I can never remember the particular IP
* cannot use domain name because they sit behind Cloudflare (sometimes)
* unable to use subdomain because it can expose the IP (sometimes)
* `.ssh/config` doesn't support grouping of servers
* My `.bashrc` file was filling up with messy `alias`es`sshh` allows you to list all your hosts in a configuration file, and then connect to them using a name.
## Usage
```bash
$ sshh project-server # connect to the `project-server` host$ sshh -g acme-corp main # connect to the `main` host under the `acme-corp` group
```Given an ambiguous host name, `sshh` will connect to the last one defined in the config file.
`sshh` ends up calling `ssh` with the suitable arguments, so make sure it is installed.
## Installation
1. Install using cargo: `cargo install sshh`
1. Download a binary from the [GitHub Releases page](https://github.com/daniellockyer/sshh/releases)
1. Build and install yourself:
1. Clone the repository
1. Build using `cargo build --release`
1. Install using `cargo install --path .`## Config
`sshh` uses the yaml file format, generally stored in `~/.config/sshh.yml`. You can pass a custom config through the `-c` flag.
A server has the following options:
* `name`: the server name
* `user` (optional): defaults to "root"
* `host`: the domain or IP address
* `port` (optional): defaults to 22
* `forwarding` (optional): whether to enable authentication agent forwarding, defaults to false
* `identity_key` (optional): the location of the identity key to use, defaults to nothingServers can be put into groups, or listed separately. List individual servers under the `servers` mapping, and groups under `groups`. The config file is deserialized using [`serde_yaml`](https://docs.rs/serde_yaml/). The example below should give a good indication of the expected format.
```yml
servers:
- name: project-server
user: banana
host: 1.2.3.4
port: 1337
forwarding: true
- name: vpn
host: 2.3.4.5
groups:
- name: random-company
servers:
- name: main
user: app
host: random-company.com
- name: backup
user: app
host: backup.random-company.com
- name: acme-corp
servers:
- name: main
host: main.acme-corp.com
- name: venus
host: venus.acme-corp.com
```