Configuration

April 22, 2023 · View on GitHub

You can set up SSH connections through the GUI or with a configuration file.

Configuration file example

hosts:
  - host-1:
      label: My Favourite Host
      ssh:
        host: my.host.com
        config:
          ServerAliveInterval: 5
          ServerAliveCountMax: 3
      autostart: true
      autoretry: true
      forward:
        - forwarding-1:
            label: My HTTP server
            spec: L 1234 localhost:8080
            autostart: true
            autoretry: true
        - forwarding-2: R 8022 22 # forwarding shorthand syntax
        - sshmon: H 8377 # forwarding shorthand syntax

  - host-2: # host shorthand syntax

config:
  autosave: true

Hosts

SSHMon is not a replacement of your SSH config!

Actually, it is recommended you set up first your host in your SSH config file (by default ~/.ssh/config), before adding it to your SSHMon config.

  • Syntax

    hosts:
      - host-id-1:
          # host config
      - host-id-2:
          # host config
      ...
    
  • List of available options

    OptionTypeDescriptionRequiredDefault
    labelstringFriendly name for the GUIno''
    ssh.hoststringHost passed to SSHnohost id
    ssh.configobjectOptions passed to SSH as -o key=valueno{}
    autostartbooleanTry to connect to host at SSHMon startupnofalse
    autoretrybooleanTry to reconnect to host on connection errornofalse
    forwardobjectForwardings for this hostno{}

Forwardings

SSHMon allows you to define port/socket forwarding on your SSH connections. Here are the possible forwardings:

TypeBindTarget
Local[address:]port or unix socket (local)[address:]port or unix socket (remote)
Remote[address:]port or unix socket (remote)[address:]port or unix socket (local)
Dynamic[address:]port (local)
HTTP[address:]port or unix socket (remote)

Please read the SSH documentation for local, remote and dynamic types.

HTTP forwarding

The HTTP forwarding type is specific to SSHMon. It establishes a local port forwarding to a unix socket managed by SSHMon, and allows access to the remote port/socket through the GUI.

It was designed to allow easy access to a remote running SSHMon instance, but should also work for other HTTP services that can be mounted under an arbitrary HTTP path prefix.

Default address values

  • For the bind parameter, if you do not specify an address, SSH has its own policy for the default interface it will bind to.
  • For the target parameter, SSH normally requires you to specify an interface. With SSHMon you may specify a single port value, the default interface being localhost.

Forwarding config

  • Syntax

    # inside host config:
    forward:
      - forwarding-1:
          # forwarding config
      - forwarding-2:
          # forwarding config
    
  • List of available options for a forwarding

    OptionTypeDescriptionRequiredDefault
    labelstringFriendly name for the GUIno''
    specstringForwarding specifiationyes
    autostartbooleanTry to forward at host connectionnofalse
    autoretrybooleanRetry to forward on errornofalse
  • Spec

    Similarly to the SSH forwarding syntax, the spec syntax is:

    Letter [bind] [target]
    

    Where the options are required following the given table:

    TypeLetterBindTarget
    LocalL
    RemoteR
    DynamicD
    HTTPH
  • Forwarding shorthand syntax

    You may replace the whole options object with the single spec string, e.g.:

    forward:
      - forward-1: L localhost:1234 localhost:8080
      - forward-2: H 8377
    

Config

  • Syntax

    config:
      autosave: true
    
  • List of available options for config

    OptionTypeDescriptionRequiredDefault
    autosavebooleanWrite to this file on config changenofalse