Summary of the new feature / enhancement
PowerShell SSH remoting supports passing OpenSSH -o options through -Options, but there does not seem to be a supported way to pass OpenSSH -F.
This means there is no clean equivalent of:
ssh -F none server01
ssh -F C:\Temp\isolated_ssh_config server01
for SSH-based PowerShell remoting:
New-PSSession -HostName server01
Enter-PSSession -HostName server01
Invoke-Command -HostName server01 -ScriptBlock { hostname }
In some environments, SSH client configuration is centrally managed on shared systems. This may include routing rules, jump hosts, proxy settings, identity files, or other defaults that are useful for normal interactive SSH usage.
However, automation and troubleshooting sometimes need to bypass inherited SSH client configuration and connect with a clean or isolated SSH configuration.
This is especially relevant when the user running PowerShell does not have permission to edit or temporarily disable the central SSH client config, for example C:\ProgramData\ssh\ssh_config on Windows. In those cases, it can be difficult to verify whether a PowerShell SSH remoting issue is caused by the target host, PowerShell remoting itself, or inherited SSH client config.
With plain OpenSSH this can be done with:
With PowerShell SSH remoting, -Options can pass ssh -o key=value options, but -F is not an ssh_config directive and cannot be represented correctly that way.
The expected benefit is that PowerShell SSH remoting would behave more consistently with direct ssh.exe usage and be easier to troubleshoot in environments where inherited SSH client config may affect connection behavior.
Proposed technical implementation details (optional)
Add a parameter for SSH-based remoting, for example:
New-PSSession -HostName server01 -SSHConfigFile none
Enter-PSSession -HostName server01 -SSHConfigFile none
Invoke-Command -HostName server01 -SSHConfigFile none -ScriptBlock { hostname }
And:
New-PSSession -HostName server01 -SSHConfigFile C:\Temp\isolated_ssh_config
This should map to the underlying OpenSSH client as:
or:
-F C:\Temp\isolated_ssh_config
-Options maps naturally to ssh -o key=value.
OpenSSH -F is a command-line option, not an ssh_config option.
Therefore this cannot be expressed correctly as:
The parameter should apply to the SSH-based remoting parameter sets used by New-PSSession, Enter-PSSession, and Invoke-Command.
Summary of the new feature / enhancement
PowerShell SSH remoting supports passing OpenSSH
-ooptions through-Options, but there does not seem to be a supported way to pass OpenSSH-F.This means there is no clean equivalent of:
for SSH-based PowerShell remoting:
In some environments, SSH client configuration is centrally managed on shared systems. This may include routing rules, jump hosts, proxy settings, identity files, or other defaults that are useful for normal interactive SSH usage.
However, automation and troubleshooting sometimes need to bypass inherited SSH client configuration and connect with a clean or isolated SSH configuration.
This is especially relevant when the user running PowerShell does not have permission to edit or temporarily disable the central SSH client config, for example
C:\ProgramData\ssh\ssh_configon Windows. In those cases, it can be difficult to verify whether a PowerShell SSH remoting issue is caused by the target host, PowerShell remoting itself, or inherited SSH client config.With plain OpenSSH this can be done with:
ssh -F none server01With PowerShell SSH remoting,
-Optionscan passssh -o key=valueoptions, but-Fis not anssh_configdirective and cannot be represented correctly that way.The expected benefit is that PowerShell SSH remoting would behave more consistently with direct
ssh.exeusage and be easier to troubleshoot in environments where inherited SSH client config may affect connection behavior.Proposed technical implementation details (optional)
Add a parameter for SSH-based remoting, for example:
And:
This should map to the underlying OpenSSH client as:
or:
-Optionsmaps naturally tossh -o key=value.OpenSSH
-Fis a command-line option, not anssh_configoption.Therefore this cannot be expressed correctly as:
The parameter should apply to the SSH-based remoting parameter sets used by
New-PSSession,Enter-PSSession, andInvoke-Command.