Stop the SSH post-quantum warning appearing in Git commands

The OpenSSH post-quantum key exchange warning in Git output comes from the ssh program Git starts, and only the client settings change whether it prints. Setting WarnWeakCrypto hides it without changing the connection, so the server still needs checking.

On this page

Why the SSH post-quantum warning shows up in my Git commands

When a git fetch, git clone or git push prints the SSH post-quantum key exchange warning, the message comes from the ssh program that Git starts, not from Git itself. The warning means the connection to the remote server is not using a post-quantum key exchange algorithm. On your side, as the developer running Git, you usually control only the client, meaning the ssh program and its configuration on your machine. The team that runs the Git server controls which key exchange algorithms that server offers, so that team is usually the one who can remove the warning at its source. Git only starts ssh when it needs to connect to a remote, so local commands that do not touch a remote will not print it.

The warning does not by itself mean the transfer failed. The connection may complete normally while still showing the message, so check the command's exit status and the actual result before treating it as an error. A real connection failure produces different output, such as an authentication error, a refused connection or a host key problem. The sources listed on this page, including the OpenSSH post-quantum page and the ssh_config(5) and ssh(1) man pages, describe options that hide this warning, such as WarnWeakCrypto=no-pq-kex. They document those options as ways to silence the message, not as the fix. Silencing the warning leaves the server's key exchange unchanged, so confirm with the team that runs the server whether it offers post-quantum key exchange before deciding how to handle the message.

Who has to act on the warning in Git commands

The warning appears in Git output, but the change that removes it sits in different places depending on who runs the command, who runs the job and who runs the server. Work through the cards below to find the side of the connection you control and the change that applies to it.

Developers running Git on their own machine

If you type git fetch, git clone or git push in a terminal, you can change the SSH options Git uses on your own machine without touching the server. Set GIT_SSH_COMMAND for a single command, or use git config core.sshCommand to make the change persistent for Git only. The git(1) manual suggests that a personal .ssh/config file is usually the easier place for these options, using a Match host block with WarnWeakCrypto no-pq-kex for specific hosts. Before you change anything, run ssh -G host to confirm which settings apply, since command-line options are read first. The warning will still describe the server, so the change hides the message rather than fixing the connection.

git(1) manual

CI and script owners

If a pipeline job or script prints the warning, the job owner controls the environment the job runs in. Set GIT_SSH_COMMAND in the job definition or script so the override applies only where Git runs, and keep it out of shared runner configuration unless every job on that runner should be affected. Check whether the job uses a wrapper script for ssh: Git picks options by the basename of the configured command and runs unrecognized commands with -G, so a wrapper must accept -G and the -o option. The ssh.variant setting or the GIT_SSH_VARIANT environment variable can override that detection. Record in the job notes that the warning is suppressed and why.

git-config manual

The Git hosting team

The team that runs a self-hosted Git server controls the key exchange algorithms that server offers, so the warning on the client side is a signal to check that server's configuration. Use ssh -Q kex and the server's KexAlgorithms setting to see which algorithms it accepts. The OpenSSH page names the fix as upgrading the server or checking its KexAlgorithms, not hiding the message. Confirm the server offers a post-quantum key exchange before deciding whether client-side suppression is needed at all. Keep a record of what the server offers so that other teams can answer questions about it.

OpenSSH PQ page

Hosted Git service customers

If your repositories sit on a hosted Git service, you can change only the SSH settings on your own machine or in your own jobs. Key exchange is set on the provider's servers, and only the service administrator or the provider can change it. Ask the provider whether its SSH endpoint offers a post-quantum key exchange and what it plans to do. The sources supplied for this page do not say that any hosted Git provider has published a specific change, so do not assume one has been made. Until the provider confirms, the client-side options above are the only changes you can make yourself.

Vendors of hosted Git services

A hosted Git vendor decides which key exchange algorithms its SSH endpoints offer, so it is the party that can remove the warning for every customer at once. Vendors should document which key exchange algorithms their servers accept and tell customers whether any change is planned. Customers can ask for that information in writing before they set client-side overrides. Where a vendor offers no post-quantum key exchange, the warning will keep appearing for every user regardless of local settings, so the vendor's answer determines how much work falls on each customer.

How to check which ssh client and key exchange Git is using

This sequence confirms which ssh program Git actually starts, which key exchange algorithms that client offers, and whether the warning comes from the client or the server before you change any setting. Each check produces output you can compare against the warning lines to decide the next step.

  1. Confirm the installed ssh client version

    Run ssh -V in the same terminal where Git fails, so you know which OpenSSH build is on your path. Note the version string it prints, because the post-quantum key exchange options you can use depend on which release you have. If the version looks older than what your team expects, record that before going further. You know this step is done when you have a version string written down next to the failing command.

  2. Print the effective configuration for the remote host

    Run ssh -G followed by the remote host name, for example ssh -G git.example.com, to print the configuration after Host and Match blocks are evaluated. Look for the kexalgorithms line and any warnweakcrypto line, since those show what ssh will actually use for that host. Compare the output with your personal ~/.ssh/config and /etc/ssh/ssh_config, because a Match block can change a setting for one host only. You know this step is done when you can state the key exchange list and warning setting that apply to that host.

  3. List the key exchange algorithms the client supports

    Run ssh -Q kex to list the key exchange algorithms this client can offer. Check whether the list includes any hybrid post-quantum algorithms, and compare it with the output from the previous step, which shows what is configured for the host. If the client list has no post-quantum entries, the warning is about the client build itself and no configuration change will make it disappear. You know this step is done when you have confirmed the client's supported list, whether or not it includes post-quantum options.

  4. Capture verbose output from a failing command

    Run the failing Git command with GIT_SSH_COMMAND set to ssh -v, then repeat with -vv and -vvv, which raise verbosity up to the maximum of three levels. To keep the output out of the terminal, you can add -E followed by a log file path, which appends debug logs to that file instead of standard error. Compare the lines that mention key exchange with the three warning lines you saw in the original output. You know this step is done when you can match each warning line to a debug line that shows the negotiated key exchange.

  5. Check whether Git redirects the ssh command

    Before you assume which ssh ran, check the GIT_SSH_COMMAND environment variable and the core.sshCommand setting in your Git configuration. Run echo $GIT_SSH_COMMAND and git config --show-origin core.sshCommand, since either one can point Git at a different program or wrapper. The environment variable takes precedence over the config setting when both are present. You know this step is done when you have confirmed which command Git will execute, and whether it differs from the ssh on your path.

  6. Record which side needs the change

    Using the version, host configuration, supported list and verbose log, decide whether the warning reflects the client you run or the server you connect to. If the client supports no post-quantum key exchange, the fix belongs on the client or in a newer build. If the client does support one but the server does not offer it, the server operator has to change its configuration or upgrade it. Write the result down with the host name, client version and log file path, so the person who maintains the server can act on it. You know this step is done when the record states which side must change.

Causes of the Git warning and the fix for each

This table pairs each cause of the post-quantum key exchange warning in Git output with the fix that matches it. Read the rows in order, because the first check is whether the client and server both offer a post-quantum key exchange, and the later rows cover settings that override or hide the warning. Setting WarnWeakCrypto only hides the message and does not change the connection.

CauseWhat to checkFix
SSH client lacks post-quantum key exchangeRun ssh -V for the version and ssh -Q kex to list supported key exchange algorithmsUpgrade the OpenSSH client on the developer machine to a release that offers a post-quantum key exchange
Git server or host offers no post-quantum key exchangeCheck the server's KexAlgorithms with the operator, or test with ssh -v against the hostAsk the Git host or server operator to upgrade the server or review its KexAlgorithms, since hiding the warning leaves the server unchanged
Wrapper set through GIT_SSH or GIT_SSH_COMMAND changes argumentsPrint the active command with git config --get core.sshCommand and echo $GIT_SSH_COMMANDRemove or correct the wrapper, or make sure it accepts the -o option that Git passes to it
core.sshCommand is overridden by the environmentCheck whether GIT_SSH_COMMAND is set, since it takes precedence over core.sshCommandUnset GIT_SSH_COMMAND or set the same value in both places so the intended command runs
Host or Match block in ssh config restricts settingsRun ssh -G host to print the configuration after Host and Match evaluationEdit the matching block in ~/.ssh/config so the directive applies only to the hosts you intend
ssh.variant misdetects the clientRun git config --get ssh.variant and check GIT_SSH_VARIANT for an overrideSet ssh.variant to ssh so Git passes OpenSSH options, or remove a value that does not match the client
Silencing the warning instead of fixing itConfirm the WarnWeakCrypto setting used with GIT_SSH_COMMAND or core.sshCommandUse the -o WarnWeakCrypto=no-pq-kex form only as a short-term choice, and keep the server's key exchange list on the record

What to change to remove the cause, not just hide the warning

This sequence fixes the client and the host first, so the post-quantum key exchange is actually used. Hiding the warning comes last and only as a temporary measure, because the message keeps describing the server until it offers a post-quantum algorithm.

  1. Check the client's key exchange algorithms

    On the developer machine or CI runner, run ssh -V to see the installed OpenSSH version, then run ssh -Q kex to list the key exchange algorithms that client supports. Look for a post-quantum algorithm in that list. If one is present, the client side is ready and you can move to the next step. If none is listed, the client needs an upgrade before anything else, so continue to the next step to plan that change. Record the output so the same check can be repeated after the upgrade.

  2. Upgrade the ssh client where needed

    If ssh -Q kex does not list a post-quantum algorithm, the person who manages the machine or CI runner upgrades the OpenSSH client package through the operating system's normal update path or the runner image. Use the release notes for the OpenSSH version to confirm which release added post-quantum key exchange. Once the upgrade is done, run ssh -V and ssh -Q kex again and confirm the post-quantum algorithm now appears in the list. Do not continue until that check passes.

  3. Ask the Git host about its KexAlgorithms

    Ask the team that runs the Git server, or the hosted Git provider, whether its SSH endpoint offers a post-quantum key exchange and what its KexAlgorithms setting contains. The OpenSSH post-quantum page describes this as the fix on the server side. Ask for the answer in writing and record the date. If the host has not enabled a post-quantum algorithm, the warning will continue to appear for that host even after your client is upgraded.

  4. Confirm the host's configuration with ssh -G

    Run ssh -G host for the Git host name you connect to. This prints the configuration after Host and Match blocks are evaluated, including the KexAlgorithms value the client will use. Check that the list includes a post-quantum algorithm. If it does not, the cause is either the client configuration in ~/.ssh/config or the server, so return to the previous steps. Keep this output as evidence of the client-side configuration.

  5. Apply the temporary Git setting if needed

    Only after the steps above, and only when the host cannot yet offer a post-quantum algorithm, you may hide the message for Git. Set GIT_SSH_COMMAND for a single command, for example GIT_SSH_COMMAND="ssh -o WarnWeakCrypto=no-pq-kex" git fetch, or make the setting persistent for Git with git config core.sshCommand "ssh -o WarnWeakCrypto=no-pq-kex". Be clear with your team that this hides the message without changing the server, so the server still does not offer a post-quantum key exchange.

  6. Set per-host options in ssh config

    For a persistent setting that applies to specific hosts, add a Host or Match block in ~/.ssh/config that contains WarnWeakCrypto set to no-pq-kex. The OpenSSH configuration man page says a block limits the directives that follow it until the next Host or Match. The git manual notes this is usually easier to maintain than per-command settings. Run ssh -G host again to confirm the option is applied to the intended host only.

  7. Check wrapper scripts accept -G and -o

    If your setup uses a wrapper script as the ssh command, for example through GIT_SSH_COMMAND or core.sshCommand, the script must accept the -G flag and the -o option. Git selects its ssh arguments from the basename of the configured command, and for an unrecognized basename it runs the command with -G to detect OpenSSH options. Test the wrapper by running git fetch against the host and by running the wrapper with -G. If the wrapper rejects either form, Git will fail or pass the wrong arguments.

How the Git fix differs by developer machine, CI runner and wrapper

On a developer laptop, Git starts the standard ssh program, so the options in the environment, the Git config or the personal SSH config all take effect. Choose the narrowest place that works. For a single command, set GIT_SSH_COMMAND in front of it. For a persistent change limited to Git, use core.sshCommand. For a permanent change scoped to particular hosts, put a Match host block in ~/.ssh/config, which the git(1) manual recommends for SSH options.

  • One command: GIT_SSH_COMMAND="ssh -o WarnWeakCrypto=no-pq-kex" git fetch applies only to that invocation.
  • Git-wide: git config core.sshCommand "ssh -o WarnWeakCrypto=no-pq-kex" persists, but the environment variable overrides it when set.
  • Host-scoped: a Match host block with WarnWeakCrypto no-pq-kex limits the change to named servers.
  • Precedence: command-line options come first, then ~/.ssh/config, then /etc/ssh/ssh_config.
  • Check the result: ssh -G host prints the configuration after Host and Match evaluation.

After any change, confirm that the warning is gone and that a real failure still appears. Hiding the message does not fix the server.

How to confirm Git no longer prints the warning

To confirm the fix worked, rerun the same Git command that printed the warning, for example git fetch against the same remote, with the same environment variable or core.sshCommand setting still in place. A successful run ends with the transfer completing, and the three warning lines no longer appear in the output. If the warning still prints, the setting is not reaching the ssh process Git starts. Check that GIT_SSH_COMMAND is set in the shell where you run Git, and that no other core.sshCommand value is overriding it. Note that GIT_SSH_COMMAND takes precedence over core.sshCommand, so a stale environment variable can hide a correct repository setting, or the reverse.

Next, confirm that the SSH option is applied to the remote host itself. Run ssh -G with the remote host name, for example ssh -G git.example.com, and check that the output includes warnweakcrypto no-pq-kex. This prints the configuration after Host and Match blocks are evaluated, so it shows whether a block in ~/.ssh/config or /etc/ssh/ssh_config is changing the result. If you set the option with the -o form on the command line, ssh -G will not show it unless you pass the same option to it. Check the client version as well: run ssh -V to see the installed release, and run ssh -Q kex to list the key exchange algorithms that client supports. Repeat both checks after any client upgrade, because a new release can change the defaults and the list.

A clean run only means the warning is hidden on your side. It does not show that the server offers a post-quantum key exchange, and the OpenSSH post-quantum page describes the actual fix as upgrading the server or checking its KexAlgorithms setting. Ask the operator of the remote host, or check its SSH configuration, for the list of key exchange algorithms it offers, and keep that finding with your change record. If the server does not offer a post-quantum key exchange, the warning will still be accurate about the server, and suppressing it only changes what you see. Use ssh -v or -E log_file if a failure appears later, since those options show the full connection log for comparison.

What can break when you change the SSH settings for Git

Each of the documented changes works by altering how the ssh program that Git starts behaves. That reach can extend beyond Git, to other hosts, scripts and pipelines, so check where each setting applies before you rely on it. The cards below cover the places where the change tends to cause trouble and what to verify in each.

Global settings reach other hosts

A WarnWeakCrypto no-pq-kex line in /etc/ssh/ssh_config or ~/.ssh/config applies to every host that matches, not only the Git remote you are working with. ssh_config(5) reads command-line options first, then ~/.ssh/config, then /etc/ssh/ssh_config, and a Host or Match block limits only the directives that follow it, up to the next block. To see what actually applies to a given host, run ssh -G host and check the resolved configuration. Scope the change to a Match host block where you can.

ssh_config(5) man page

Wrapper scripts can fail

Git chooses ssh arguments from the basename of the configured command. For an unrecognized basename, Git runs the command with -G and uses OpenSSH options only if that succeeds. A wrapper script set through GIT_SSH_COMMAND or core.sshCommand therefore has to accept -G and the -o option, or Git may pass arguments it cannot handle. If a wrapper fails after you add the option, set ssh.variant or GIT_SSH_VARIANT to state the variant explicitly, and test with a real fetch.

git-config manual

Pinned CI clients behave differently

A CI job pinned to an older OpenSSH client may not recognize the WarnWeakCrypto option or the no-pq-kex flag, or may report key exchange differently from a newer runner. Before you rely on the change in a pipeline, run ssh -V on the runner to confirm the client version and ssh -Q kex to list the key exchange algorithms it supports. Compare the output of a failing job against a passing one, and make the setting part of the pipeline definition so the runner image and the change stay in step.

ssh(1) man page

Silenced warnings hide real errors

Setting WarnWeakCrypto only hides the post-quantum message. The OpenSSH page names the fix as upgrading the server or checking its KexAlgorithms, so the warning would still describe the server if it offers no post-quantum key exchange. Do not use ssh -q as a substitute: it suppresses most warning and diagnostic messages, which would also hide real problems. When a Git command fails, run it with ssh -v, or log with -E log_file, to see the full diagnostic output.

OpenSSH PQ page

When to get help with the SSH warning in Git

Get help when the fix is not something you can make on your own machine. Most people can silence this warning for a single command or in their own Git configuration, but several situations call for outside help: you cannot upgrade the ssh client on your workstation or build agent, the warning comes from a Git server you do not run, many hosts or CI jobs print it, or a regulated environment needs evidence of the change. Each of these pushes the work toward someone who controls the client fleet, the server, or the audit trail. Before you escalate, run ssh -V and ssh -Q kex on the machine that prints the warning so you can tell the owner exactly which client version and key exchange list you are dealing with.

If the warning comes from a server you do not run, such as a hosted Git service or a partner's file transfer endpoint, the decision belongs to the operator. Hiding the message with GIT_SSH_COMMAND or core.sshCommand only changes what your client prints. It does not change what the server offers, and the OpenSSH page names upgrading the server or checking its KexAlgorithms as the actual fix. Ask the operator whether post-quantum key exchange is planned, and record their answer. Where many hosts or CI jobs print the warning, the change should be made once in a shared configuration, not edited into each job, and that shared change needs an owner.

DeployOpen plans, upgrades, configures and documents the SSH clients, Git servers, CI runners and related components involved in this warning, so your team can move from suppressed output to a tested configuration. DeployOpen does not issue audit reports or certifications. If an assessor or customer needs evidence, DeployOpen can prepare the configuration records, change history and test results that the assessor reviews, but the independent auditor or certification body makes the judgment. Confirm the scope of that evidence in writing before the work starts.

Questions developers ask about the SSH warning in Git

Is the connection still encrypted when Git shows the SSH post-quantum warning?

Yes. The warning reports that the key exchange algorithm negotiated for the connection is not a post-quantum one. It does not say the session is unencrypted, and the sources do not describe the data as sent in the clear. Git still runs over SSH, and the encryption is what the server and client agreed on. The warning concerns which key exchange was chosen, so the practical question is whether your server and client can offer a post-quantum option, which you can check with ssh -Q kex and ssh -G host for the host in question.

Is the SSH post-quantum warning urgent for my Git work?

The sources do not set a deadline for this warning, and they do not say that a missing post-quantum key exchange breaks anything today. The OpenSSH post-quantum page presents the warning as a signal that the server should be upgraded or that its KexAlgorithms should be checked. Who acts on it depends on the setup. A developer on a personal machine can usually wait for an update, while a team that runs its own Git server should confirm the server's key exchange list. Ask your platform or security team whether your organization has set a timeline for it.

Can I silence the SSH post-quantum warning in Git?

Yes, the warning can be hidden. For a single command, set the environment variable: GIT_SSH_COMMAND="ssh -o WarnWeakCrypto=no-pq-kex" git fetch. To make it persistent for Git only, run git config core.sshCommand "ssh -o WarnWeakCrypto=no-pq-kex". You can also add a Match host block with WarnWeakCrypto no-pq-kex to your .ssh/config for specific hosts. Hiding the message does not change the negotiated key exchange, and the OpenSSH page names the fix as upgrading the server or checking its KexAlgorithms. Treat silencing as a short-term choice and document it.

Why does the SSH post-quantum warning appear in Git now?

The warning is printed by the ssh program that Git starts, not by Git itself. Git only uses ssh when it has to connect to a remote, such as on fetch and push over SSH. The warning appears when the negotiated key exchange is not post-quantum, and newer OpenSSH releases report this. Whether you see it depends on your installed ssh version and on what the remote server offers. Run ssh -V to see your client version, and run ssh -Q kex to list the key exchange algorithms your client supports. The sources do not say when your specific host or release started showing the warning.

What should I do if I cannot upgrade the SSH client or server?

If you cannot upgrade, you have three options, and the right one depends on who controls the machine. First, if you run the server, check its KexAlgorithms setting and confirm what it offers. Second, if you only use the client, you can hide the warning with the documented WarnWeakCrypto=no-pq-kex option, either per command or in core.sshCommand. Third, if you use a wrapper script for SSH, it must accept -G and the -o option, because Git detects the SSH variant from the command's basename. Record the workaround in your team's notes so that it is revisited when the client or server is upgraded.

How do I tell a real SSH connection error from the post-quantum warning?

The post-quantum warning is printed as a notice, while a real connection error stops the command or reports a failure. To compare them, run the Git command with ssh -v through GIT_SSH_COMMAND, which prints debugging messages, and raise verbosity with extra -v flags up to 3 if you need more. You can also send debug output to a file with -E log_file. Look for the three warning lines and check whether the command exits with an error. Avoid ssh -q to hide output, because it suppresses most diagnostic messages and would hide real errors too.

Will hiding the warning break my Git commands in CI jobs?

Hiding the warning with WarnWeakCrypto=no-pq-kex only suppresses the message. The sources do not say that it changes authentication, host verification or the data sent, so a job that passes with the warning hidden should behave the same. Set the variable in the CI job's environment rather than in a shared file, so that the workaround is visible in the job configuration. Confirm the behavior in your own pipeline by running a test fetch and push with the setting in place.

How DeployOpen helps fix the SSH warning in Git and its servers

DeployOpen works through the Git side of the warning in the order it appears: first which ssh program Git starts, then the narrowest setting that hides only this message, and then a check that real connection errors still show. Engagements are scoped in writing before any change is made to your Git clients, CI jobs or server configuration.

How we scope

  • We confirm which Git hosts, CI runners and scripts print the warning, and which ssh program each one starts.
  • We record whether GIT_SSH_COMMAND, core.sshCommand or ~/.ssh/config already sets options, since these take precedence.
  • Engagements are fixed-scope, and the written scope states which hosts and jobs are covered and what is excluded.

How we build

  • We set the WarnWeakCrypto no-pq-kex option for one command, one job or one host block, following the documented -o form.
  • Where a wrapper script is used for ssh, we confirm it accepts -G and -o, because Git inspects those when it picks options.
  • We test a failing Git command against the three warning lines, so a real connection error is not hidden by the change.

How we hand over

  • We document each setting, its scope and its file location, so the team can see which clients and jobs were changed.
  • We record the ssh -V and ssh -Q kex output for the client versions in use, so the state of each client is on file.
  • We note that the setting only hides the message, and that the server's key exchange list still needs checking separately.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, so client changes are rechecked after updates.
  • When a server is upgraded or its KexAlgorithms change, we retest the Git commands that connect to it.
  • Where a hidden warning is no longer needed, we help remove the setting so the warning shows again as intended.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.