Shared server guidance · Question & answer

How do I see the SSH settings that will actually be used?

Use ssh -G to print the effective client configuration after matching Host and Match rules. This is useful when a short alias unexpectedly chooses another username, port or key. It does not authenticate to the server.

IntermediateWindows 11 with Microsoft OpenSSH Client; Windows PowerShell 5.1 or PowerShell 7 as labelledLinux VPS and dedicated servers where a remote Linux command is shown
Go to the answer

Instructions

1. Inspect only the connection fields you need

Pass the same destination or alias you normally use. Avoid publishing a complete configuration dump because it may include internal hostnames and paths.

Local Windows PowerShell
ssh -G example-server | Select-String -Pattern "^hostname |^user |^port |^identityfile |^identitiesonly "

The filtered lines show the target and identity settings that the client resolves.

2. Compare an explicit option

Command-line options can override ordinary configuration values. Inspect the result before making a permanent edit.

Local Windows PowerShell
ssh -G -p 2222 adminuser@vps.example.com | Select-String -Pattern "^hostname |^user |^port "

This shows how the explicit user and port affect this invocation. It still does not open a connection.

3. Correct the narrow source of the mismatch

Inspect the relevant Host block and any included file. Keep a host-specific correction local to that entry, then repeat -G. Do not rewrite system-wide SSH configuration merely because one alias is wrong.

Check the result

  • The effective values match the intended endpoint and account.
  • A subsequent authenticated connection reaches the same server.

Troubleshooting

The expected key is absent
Check IdentityFile spelling, file ordering and which Windows profile supplies the configuration.
The output differs from a colleague’s
They may use another client version, profile, system configuration or included file.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.