Skip to content

Configuration Precedence

Mehdi edited this page Nov 27, 2026 · 2 revisions

Configuration Precedence

When the same option is set in more than one place, which value wins? SSH Pilot uses OpenSSH's own precedence, with no rules of its own. A saved host connects exactly as typing ssh <alias> in a terminal would.

To override that, use Settings → SSH Options. Options set there beat everything in every configuration file.


The short version

  1. OpenSSH decides. Everything you set in the connection editor or a login profile is written as normal lines into the host's Host block in ~/.ssh/config. OpenSSH then picks the value, as it would in a terminal: for most options, the first value it finds, reading the file from top to bottom.
  2. Settings → SSH Options beat everything. They are added to every SSH command, and the command line wins over every file. This is how you override OpenSSH's precedence. They start empty, so nothing is overridden until you set something.
  3. SSH Pilot never reorders your file, never blocks an edit, and never quietly changes what you wrote to make a value win. It marks a setting that has no effect and tells you which line wins instead.

The order OpenSSH reads things

For each option, OpenSSH takes the first value it obtains, in this order:

# Source Notes
1 The command line What SSH Pilot adds (see below). Nothing from your Host block is repeated here.
2 Your configuration file (~/.ssh/config), top to bottom Global options first, then every Host and Match block that applies to this host, in file order. An Include is read at the place where its line stands.
3 The system-wide file (/etc/ssh/ssh_config) Read after your own file, as in a terminal. Skipped in Isolated Mode.
4 OpenSSH's built-in defaults For anything nobody set.

"First value wins" in practice

Host *
    User admin

Host web-prod
    HostName 203.0.113.10
    User deploy

Connecting to web-prod logs in as admin, not deploy: the Host * block comes first, so its User wins. This is how OpenSSH has always worked, and a terminal gives the same result. To let each host choose, put general defaults like this in a Host * block at the end of the file.

A host can have more than one block. A Host * placed between two of them decides whatever the later block sets, unless the host's earlier block already set it.

Options that collect every value

A few options don't keep the first value; OpenSSH uses all of them, in order: IdentityFile, CertificateFile, LocalForward, RemoteForward, DynamicForward, SendEnv, SetEnv and PermitRemoteOpen. A key in Host * and a key in the host's own block are both offered, the first one first.

Match blocks

A Match block applies when its conditions hold, and it then takes part in "first value wins" at its place in the file. SSH Pilot lets OpenSSH evaluate every Match rather than guessing. A Match exec block runs a command to decide. SSH Pilot asks before running such a command while it shows you the configuration.


What SSH Pilot adds to the command line

With nothing set in Settings → SSH Options, a launch resolves to the same configuration as ssh <alias>. SSH Pilot adds only the following:

  • Overrides you chose in Settings → SSH Options. Connect Timeout, StrictHostKeyChecking, Compression, AddressFamily and any Additional Options apply to every connection and beat every file. Leave a setting at Not set to let your configuration decide. For the collecting options above (IdentityFile, forwards, SendEnv…), an Additional Option is added to the host's own values rather than replacing them.
  • Connection multiplexing, only when you turn on Enable SSH connection multiplexing: SSH Pilot's own ControlMaster settings.
  • Legacy device compatibility, when turned on: the older algorithms some old devices need.
  • A keepalive fallback. Settings → SSH Options → Keepalive is only used for a host whose configuration sets no ServerAliveInterval at all. A value in your file, even ServerAliveInterval 0, always wins.
  • What an operation needs to work:
    • A private debug log, so SSH Pilot can follow the session.
    • The SFTP subsystem for the file manager.
    • A single password prompt and no forwards for file transfers.
    • PermitLocalCommand=no for launches that are not a terminal login, so a host's LocalCommand runs for terminals only. Those launches are the dashboard, the file manager, dedicated forwards, scp and ssh-copy-id.
  • In Isolated Mode: SSH Pilot's own configuration is passed with -F (so OpenSSH skips the system-wide file), plus its own known-hosts file unless your configuration names one.

Port knocking, Wake-on-LAN and the %h/%p/%u tokens of a pre-connect command use the host, port and user OpenSSH resolves, so they follow the same rules.


Where SSH Pilot's own settings end up

You set it in… It is written to… It wins over…
The connection editor The host's own Host block Later blocks only, like any line in that block
A login profile The Host block of every linked connection The same as the editor: it is just lines in the block
Settings → SSH Options Every SSH command line Everything in every file

Login profiles and groups

  • A profile assigned to a connection wins over a profile on its group. A subgroup's profile wins over its parent group's.
  • A profile only applies the settings it actually sets. Anything it leaves empty stays as each connection has it.
  • When an edit makes a profile set something that linked connections had set themselves, the profile wins, after one confirmation listing what will be replaced. A connection that needs to differ uses Don't use a profile.
  • If you edit a linked host's authentication lines by hand, SSH Pilot detaches it from the profile instead of overwriting your edit.

The profile's lines still sit in the host's block, so a Host * earlier in the file can beat them exactly as it beats lines you typed yourself.

Shared and pattern blocks

  • A block that names several hosts (Host web1 web2) is edited for all of them, or you can choose Edit Separately to give one host a block of its own (added at the end of the file).
  • Pattern blocks (Host *.lan) and Match blocks are not connections. Edit them in Advanced Configuration, or create one with New Host Rule….

Not part of the SSH configuration

Connections of other protocols (RDP, Telnet, Serial, Mosh, Docker, Kubernetes) are kept in SSH Pilot's own settings, not in ~/.ssh/config, so none of these rules apply to them.


Finding out why a value was used

  • Connection editor. A field whose value has no effect is marked No effect and names the line that wins. Fields overridden by Settings are marked too, and a banner at the top counts both and has an Advanced Configuration button. For login methods, OpenSSH will try: shows the order OpenSSH will really use when it differs from the one set on the page. Your edit is always saved as you made it.
  • Advanced Configuration → Effective. Every option with its final value and where it comes from: this block, another block, an included file, the system-wide file, Settings, or OpenSSH's default.
  • Advanced Configuration → Directives. A line that has no effect is struck through and says which line OpenSSH uses instead.
  • From a terminal: ssh -G <alias> prints the same final configuration OpenSSH computes. SSH Pilot's answers come from this same command.

Making your value win

  • Override it in Settings → SSH Options. This beats every configuration file. It applies to every connection, so use it for values you want everywhere (a timeout, host key checking, compression, an address family, or any other option under Additional Options).
  • For one host only, change the file. Put Host * and broad patterns at the end of the file, or remove the option from the general block. Advanced Configuration shows every block in order and lets you move or edit them. SSH Pilot never does this for you, because moving a block changes other hosts too.

Related

Clone this wiki locally