Unsupported option "accept-new". Could not read from remote repository

Getting Below error when a pipeline job is invoked. I am running jenkins as container on AlmaLinux8.8. when did some troubleshooting "unsupported option “accept-new” generally comes when there is git version mismatch

[16:26:58] Fetching changes from the remote Git repository
[16:26:58] Pruning obsolete local branches
[16:26:58] Cleaning workspace
[16:26:59] ERROR: Error fetching remote repo 'origin'
[16:26:59] hudson.plugins.git.GitException: Failed to fetch from ssh://phab@phabricator.com/source/nos.git
[16:26:59] at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
[16:26:59] at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1241)
[16:26:59] at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1305)
[16:26:59] at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)
[16:26:59] at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)
[16:26:59] at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)
[16:26:59] at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[16:26:59] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[16:26:59] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[16:26:59] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[16:26:59] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[16:26:59] at java.base/java.lang.Thread.run(Thread.java:840)
[16:26:59] Caused by: hudson.plugins.git.GitException:
Command "git fetch --no-tags --force --progress --prune -- ssh://phab@phabricator.com/source/nos.git refs/heads/prj-jenkins:refs/remotes/origin/prj-jenkins" returned status code 128:
[16:26:59] stdout:
[16:26:59] stderr: command-line line 0: unsupported option "accept-new".
[16:26:59] fatal: Could not read from remote repository.

That message almost always means that the version of OpenSSH that is being used by command line git is older than OpenSSH 7.6. OpenSSH 7.6 introduced the accept-new option.

My Red Hat Enterprise Linux 8.9 reports its ssh version as:

$ ssh -V
OpenSSH_8.0p1, OpenSSL 1.1.1k  FIPS 25 Mar 2021

I would expect the same OpenSSH version or at least a very similar OpenSSH version on your AlmaLinux 8.8. When I checked an AlmaLinux 8 container image with the following commands, it reported the same version:

$ docker run --rm -i -t almalinux:8 /bin/bash
# dnf update
# dnf install -y openssh-clients
# ssh -V
OpenSSH_8.0p1, OpenSSL 1.1.1k  FIPS 25 Mar 2021

Since your ssh is reporting that accept-new is not a valid option, I suspect that your agent or your controller are running a version of ssh that is older than OpenSSH 7.6. You can check that with the ssh -V command from inside your Jenkins Pipeline.

A first guess would be that the agent is running a Red Hat Enterprise Linux 7 or a derivative, like CentOS 7, Oracle Linux 7, Scientific Linux 7, or Amazon Linux 2. Red Hat Enterprise Linux 7 and its derivatives have not been supported by Jenkins since Nov 16, 2023. More details are available in the operating system end of life blog post.

Thanks Mark you are right my agent(jenkins node) is centos7.9 and it has
ssh -V
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
I am trying to configure Alma8.8 as an agent. Thanks for the pointer.