A simple terminal-based SSH host selector written in Go. It parses your ~/.ssh/config file and presents a interactive menu to choose which host to connect to.
- Parses SSH config files automatically
- Interactive TUI menu using Bubbletea
- Tmux integration: creates new windows for SSH sessions when running inside tmux
- Fast and lightweight
go install github.com/antonjah/ssm/cmd/ssm@latestAdd ssm as an input to your flake:
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
ssm.url = "github:antonjah/ssm";
ssm.inputs.nixpkgs.follows = "nixpkgs";
};
}Then use it in one of two ways:
{
home.packages = [
inputs.ssm.packages.${system}.default
];
}Or with an overlay:
{
nixpkgs.overlays = [ inputs.ssm.overlays.default ];
home.packages = with pkgs; [
ssm
];
}{
imports = [ inputs.ssm.homeModules.default ];
programs.ssm.enable = true;
}- Ensure your SSH config is set up at
~/.ssh/configwith host entries:
Host server1
HostName 192.168.1.100
User myuser
Host server2
HostName example.com
User anotheruser
IdentityFile /home/foo/.ssh/id_rsa- Run the program:
ssm-
Use arrow keys to navigate, Enter to select, or type to filter hosts.
-
The program will connect to the selected host using SSH.
When running inside a tmux session, the program will:
- Create a new tmux window for the SSH session
- Switch to existing window if one already exists for that host
- Name windows as
ssh:hostname
