s1h
is a simple TUI inspired by K9s.
This repository contains two command-line tools written in Golang:
- s1h - Quickly SSH/SCP into configured hosts defined in your ssh config file.
- s1hpass - Manage credentials securely. Used for key-less access.
From go:
# Install from Go directly:
go install github.com/noboruma/s1h/cmd/s1h@latest
go install github.com/noboruma/s1h/cmd/s1hpass@latest
Or from the repository:
# Or build from the repository source
git clone https://github.com/noboruma/s1h
cd s1h
make build
# You can also install directly using Go
go install ./...
Or download the binaries directly (choose your os/arch):
# download the binaries from the release
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/darwin-arm64.tar.gz
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/darwin-amd64.tar.gz
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/linux-arm64.tar.gz
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/linux-amd64.tar.gz
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/windows-arm64.tar.gz
wget https://github.com/noboruma/s1h/releases/download/v0.0.1/windows-amd64.tar.gz
tar xvf chosen.tar.gz
The s1h
tool reads the SSH config file and allows you to select a host to SSH into using either a password or SSH keys.
s1h
This command displays a list of available SSH hosts from your ~/.ssh/config
, allowing you to select one and connect. It also allows you to use scp commands.
Let's image you have the following SSH config file (i.e. ~/.ssh/config
):
Host alive-vm
Hostname ***.**.**.***
User root
IdentiftyFile ~/my-priv-key
Host dead-vm
Hostname ****.io
User root
IdentiftyFile ~/my-priv-key
Host alive-vm2
Hostname ***.***.***.***
User root
Simple execute the following:
s1h
Green entries are ssh reachable hosts. Red indicates the host are not reachable with the given hostname & port.
You can search hosts or hostname using repectively F1
amd F4
to jump directly to entries:
-
If you press
enter
and it will automatically use the configured authentication method (password or SSH key) to establish the connection. This opens a new shell on the remote host. -
If you press
c
it will give the option to upload a file to the selected host: -
If you press
C
it will give the option to download a file from the selected host:
The s1hpass
tool provides options to create an encryption key and update username-password pairs securely. This is useful for host that requires password instead of a key.
s1hpass create-key
This command generates a new encryption key for securing credentials stored locally.
s1hpass upsert <host> <password>
This updates the stored credentials for the specified ssh host.
s1hpass create-key
# Output: Master key saved to ~/.config/s1h/master.key
s1hpass upsert remote-vm mySecureP@ss
# Output: Credentials updated.
s1hpass remove remote-vm
# Output: Credentials removed.
This project is licensed under the MIT License.
Pull requests are welcome! Feel free to submit issues or suggestions.
Author: Thomas Legris