Skip to content

SSH Config Import

CtrlUserKnown edited this page Jul 22, 2026 · 1 revision

SSH Config Import

ssm can import hosts directly from your existing OpenSSH ~/.ssh/config file. It parses each concrete Host block and turns it into a session, carrying across the directives ssm models: HostName, Port, User, and ProxyJump.

Usage

ssm --import                    # import from ~/.ssh/config
ssm --import /path/to/ssh_config

You can also import from the TUI via Spacei.

What gets imported

ssh_config directive ssm field
Host (the block name) session name
HostName host
User user
Port port (default 22)
ProxyJump proxy_jump

What gets skipped

  • Wildcard blocks (Host *, Host web-*) are patterns, not real hosts, so they're skipped.
  • Duplicate names — if a session with the same name already exists, the import skips it (no overwrites).
  • Blocks with no host — entries that resolve to no concrete hostname are skipped.

Example

Given this ~/.ssh/config:

Host bastion
    HostName 10.0.0.1
    User admin
    Port 2222

Host prod-web-*
    HostName 192.168.1.%h
    User deploy
    ProxyJump bastion

ssm imports bastion (with host 10.0.0.1, user admin, port 2222) and skips the wildcard prod-web-* block.

Imported sessions carry their ProxyJump directive across automatically, so jump-host connectivity is preserved.

Clone this wiki locally