Website ·
English | 日本語 | 한국어 | Tiếng Việt | 简体中文
sshw is a small SSH client wrapper for people who jump between many servers. Define hosts once in YAML, pick one from a searchable terminal menu, and let sshw open the session with the right user, port, key, password, agent, jump host, and optional startup commands.
- Browse SSH targets in an interactive terminal selector instead of typing long
sshcommands. - Search across nested host groups with
sshw -search <keyword>. - Configure
~/.sshw.yamlfrom a local web UI withsshw -config. - Connect directly by alias, for example
sshw dev. - Organize hosts into nested groups for teams, environments, or network segments.
- Use password, key file, passphrase key, SSH agent, or keyboard-interactive authentication.
- Route through a configured jump host.
- Import entries from
~/.ssh/configwithsshw -s. - Run optional callback commands after the remote shell opens.
Install the latest version with Go:
go install github.com/yinheli/sshw/cmd/sshw@latestBuild the current checkout:
./build.shThe binary is written to dist/<os>-<arch>/sshw. Set GOOS, GOARCH,
VERSION, or OUTPUT_DIR to override the target, version, or output directory:
GOOS=linux GOARCH=amd64 VERSION=dev ./build.shYou can also download prebuilt binaries from GitHub Releases.
Create a config file:
touch ~/.sshw.ymlAdd at least one host:
- name: dev
alias: dev
host: 192.168.8.35
user: appuser
port: 22
keypath: ~/.ssh/id_rsaOpen the selector:
sshwOr connect by alias:
sshw devOpen the interactive global host search. The optional initial keyword remains editable, and deleting characters restores previously filtered hosts:
sshw -search
sshw -search devStart the local web config editor for ~/.sshw.yaml:
sshw -configsshw loads the first config file it finds in this order:
~/.sshw~/.sshw.yml~/.sshw.yaml./.sshw./.sshw.yml./.sshw.yaml
To create or update ~/.sshw.yaml from a local web UI, run:
sshw -configThe editor opens the local URL in your default browser and also prints it in
the terminal. It serves only on 127.0.0.1 by default. Its three-pane workspace
supports nested group management, scoped search by server or group fields, and
adding, editing, duplicating, moving, and deleting servers. It also supports
common host fields, jump hosts, callback commands, empty groups, unsaved-change
tracking, and keyboard save. The interface follows the browser language on first
use and can switch between English, Simplified Chinese, Japanese, Korean, and
Vietnamese. If the browser cannot be opened, the server keeps running and you
can open the printed URL manually.
To edit another file, pass -config-file:
sshw -config -config-file ./.sshw.yamlTo use a different local bind address:
sshw -config -config-addr 127.0.0.1:9000Each entry can be a host or a group. Host fields:
| Field | Purpose |
|---|---|
name |
Display name in the selector. |
alias |
Optional shortcut used by sshw <alias>. |
host |
Hostname or IP address. |
user |
SSH username. Defaults to root when omitted. |
port |
SSH port. Defaults to 22 when omitted. |
password |
Password authentication value. |
keypath |
Private key path. ~ is expanded. |
passphrase |
Passphrase for the configured key. |
agentpath |
SSH agent socket path. |
jump |
One or more jump host definitions. |
children |
Nested hosts or groups. |
callback-shells |
Commands sent after the shell starts. |
- { name: dev with password, alias: dev, user: appuser, host: 192.168.8.35, port: 22, password: 123456 }
- { name: dev with key, user: appuser, host: 192.168.8.35, keypath: ~/.ssh/id_rsa }
- { name: default root and port, host: 192.168.8.35 }
- { name: "emoji host", alias: spark, host: 192.168.8.35 }- name: app via bastion
alias: app
user: appuser
host: 192.168.8.35
port: 22
keypath: ~/.ssh/id_rsa
jump:
- user: appuser
host: 192.168.8.36
port: 2222
keypath: ~/.ssh/bastion_rsa- name: production
children:
- { name: app-1, user: root, host: 192.168.1.2 }
- { name: app-2, user: root, host: 192.168.1.3 }
- { name: app-3, user: root, host: 192.168.1.4 }callback-shells sends commands to the remote shell after login. delay is measured in milliseconds.
- name: dev with startup commands
alias: dev
user: appuser
host: 192.168.8.35
keypath: ~/.ssh/id_rsa
callback-shells:
- { cmd: "cd /srv/app" }
- { delay: 1500, cmd: "docker ps" }To build the selector from your local SSH config instead of .sshw.yml, run:
sshw -ssshw reads Host, HostName, User, Port, IdentityFile, and IdentityAgent from ~/.ssh/config.
sshw open the interactive selector
sshw <alias> connect to a configured alias
sshw -s load entries from ~/.ssh/config
sshw -search [keyword] interactively search by name, alias, user, host, or port
sshw -q [keyword] shorthand for -search
sshw -config edit ~/.sshw.yaml from a local web UI
sshw -c shorthand for -config
sshw -version print build and Go version
sshw -v shorthand for -version
sshw -help show flags
sshw -h shorthand for -help
- Do not commit real passwords, private keys, or production host details to a public repository.
- If
useris omitted,sshwusesroot. - If
portis omitted,sshwuses22. - Jump host support currently uses the first configured jump entry.
If sshw saves you time, you can support its continued development with a
small donation. Thank you for helping keep the project maintained.
WeChat Pay / Alipay · USDT (TRON) — use the TRON network only for USDT.


