A user-friendly, interactive TUI for managing your ~/.ssh/config file.
About • Demo • Features • Installation • Quick-Actions
SSH Manager provides a simple and robust terminal interface for all your common SSH configuration tasks. It's designed to be a powerful alternative to manually editing your ~/.ssh/config file, reducing errors and saving time.
It is a single, self-contained bash script with no external dependencies beyond standard command-line tools, making it highly portable and easy to use anywhere.
+ SSH Manager
──────────────────────────────────────────────────────────────────────
HOST ALIAS user@hostname[:port] (key)
──────────────────────────────────────────────────────────────────────
❯ kvm [email protected]:223
(~/.ssh/id_ed25519)
kube [email protected]
[dev, test, kube] (~/.ssh/kube_id_ed25519)
──────────────────────────────────────────────────────────────────────
Host Actions: (A)dd | (D)elete | (C)lone │ ? more options
Host Edit: (E)dit host details │ Q/ESC (Q)uit
Filter: (F)ilter by tag or alias
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Host Actions: (A)dd | (D)elete | (C)lone │ ? fewer options
Host Edit: (E)dit host details │ Q/ESC (Q)uit
Filter: (F)ilter by tag or alias
Manage: SSH (K)eys | (P)ort Forwards
(O)pen ssh config in editor
Connection: ENTER Connect | (t)est selected | (T)est all
Navigation: ↓/j Move Down | ↑/k Move up
──────────────────────────────────────────────────────────────────────+ Add New SSH Host
──────────────────────────────────────────────────────────────────────
Configure the new host:
1) Host (Alias) : (not set)
2) HostName : (not set)
3) User : daniel
4) Port : 22
5) IdentityFile : (not set)
6) Tags : (not set)
c) (C)ancel/(D)eset fields
s) (S)ave and Quit
q) (Q)uit without saving (or press ESC)
[?] Your choice: + Key Management
──────────────────────────────────────────────────────────────────────
KEY FILENAME TYPE BITS COMMENT
──────────────────────────────────────────────────────────────────────
❯ some_Name ED25519 256 @iamdanielv
server1 ED25519 256 @iamdanielv
id_ed25519ssssssssssssss… ED25519 256 daniel@something…
id_rsa RSA 3072 daniel@pop-os
──────────────────────────────────────────────────────────────────────
Key Actions: (A)dd | (D)elete | (R)ename │ Q/ESC Back
(C)opy to server | (V)iew public | Re-gen (P)ublic
Navigation: ↓/j Move Down | ↑/k Move up
──────────────────────────────────────────────────────────────────────+ Saved Port Forwards
──────────────────────────────────────────────────────────────────────
HOST FORWARD
[ ] PID TYPE DESCRIPTION
──────────────────────────────────────────────────────────────────────
❯ dev.local 8081:localhost:80
[-] off Remote web server on dev
kube.test 8082:localhost:80
[-] off Local web server on kube
──────────────────────────────────────────────────────────────────────
Actions: (A)dd | (D)elete | (E)dit | (C)lone | ENTER Start/Stop
Navigation: ↓/j Move Down | ↑/k Move up │ Q/ESC Back
──────────────────────────────────────────────────────────────────────- Responsive TUI: Terminal interface with:
- Clean, aligned, table-like layouts for all lists.
- Collapsible footers to maximize content visibility.
- In-place actions (start/stop, delete) for a smooth, flicker-free workflow.
- input validation to prevent configuration errors.
- Tagging and Filtering:
- Assign tags to hosts to organize them.
- Filter the host list by tag or alias to quickly find what you need. The project is split into two scripts with distinct features:
The main script provides a TUI for all your common, day-to-day SSH tasks.
- Server Management:
- Interactively select a host and connect.
- Add new hosts from scratch or by cloning an existing one.
- Edit host parameters (alias, hostname, user, port, key file, tags) using a step-by-step wizard.
deleteandclonehosts.- Test the connection to a single host or all hosts in parallel.
- Key Management:
- Generate new
ed25519orrsakey pairs. deleteandrenamekey pairs.- Copy public keys to a remote server using
ssh-copy-id. - Re-generate a public key from a private key.
- View public key contents.
- Generate new
- Port Forwarding:
- Save, manage, and activate port forward configurations (
~/.ssh/port_forwards.conf). - View live status of active forwards.
add,edit,delete, andclonesaved configurations.
- Save, manage, and activate port forward configurations (
- Direct Config Editing:
- A top-level menu option provides a shortcut to open your entire
~/.ssh/configfile in your default$EDITOR.
- A top-level menu option provides a shortcut to open your entire
This script provides a focused TUI for more complex or potentially destructive operations, accessible via a separate command.
- Advanced Editing: Open a specific host's entire configuration block in your
$EDITOR. - Backup: Create a timestamped backup of your config file.
- Import/Export: Export selected host configurations to a new file or import them from a file into your main config.
- Host Management: The advanced view also allows for quick access to edit hosts in the editor, backup, import, and export.
You can add tags to your hosts to organize them. Tags are stored as a comment in the host's configuration block:
Host my-server
HostName 192.168.1.100
User admin
# Tags: web, productionTo filter the hosts list, press f in the main view and enter a tag or part of a host's alias.
Bypass the interactive menus for quick, direct actions.
-c, --connect: Go directly to host selection for connecting.-a, --add: Go directly to the 'Add a new server' menu.-p, --port-forward: Go directly to the 'Port Forwarding' menu.-l, --list-hosts: List all configured hosts and exit.-f, --list-forwards: List active port forwards and exit.-t, --test [host|all]: Test connection to a specific host, all hosts, or show the selection menu.-h, --help: Show the help message.
-h, --help: Show the help message.
This project now consists of two scripts:
ssh-manager.sh: The main script for day-to-day server, key, and port-forwarding management.advanced-ssh-manager.sh: A separate script for advanced tasks like backups, import/export, and direct file editing.
-
Clone the repository:
git clone https://github.com/iamdanielv/ssh-manager.git cd ssh-manager -
Build the standalone scripts: The source code is in the
src/directory. A build script is provided to bundle them into standalone executables.make build
This will create the
ssh-manager.shandadvanced-ssh-manager.shexecutables in thedist/directory. -
Run it:
./dist/ssh-manager.sh # or for advanced tools: ./dist/advanced-ssh-manager.shFor convenience, place it in a directory that is in your
PATH(e.g.,~/.local/binor/usr/local/bin) to run it from anywhere.# Example: sudo mv dist/ssh-manager.sh /usr/local/bin/ssh-manager ssh-manager # Now you can run it like this
This project uses a Makefile to streamline common development and build tasks. Run make or make help to see a list of all available commands.
make build: Builds the standalone, distributable scripts in thedist/directory. This is the recommended way to create the final executables.make clean: Removes thedist/directory and other build artifacts.
make test: Runs the entire test suite located in thetest/directory.
You can run the scripts in two ways:
-
Development Mode: Run the scripts directly from the
src/directory. This is useful for quick testing during development as it doesn't require a build step.make ssh-manager make advanced-ssh-manager make playground
-
Distribution Mode: Build and then run the final standalone scripts. This is how an end-user would run them.
make dist-ssh-manager make dist-advanced-ssh-manager
The script relies on a set of common command-line tools that are pre-installed on most Linux and macOS systems:
ssh, ssh-keygen, ssh-copy-id, awk, cat, grep, rm, mktemp, cp, date
I'm open to and encourage contributions of bug fixes, improvements, and documentation!
MIT License - See the LICENSE file for details.
Let me know if you have any questions.