Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9104027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:46:02+00:00 2026-06-17T01:46:02+00:00

I am trying to clone a Git repo using a custom SSH command. I

  • 0

I am trying to clone a Git repo using a custom SSH command. I set the SSH command in the GIT_SSH environmental variably be running

export GIT_SSH="/usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key".

But when, after the previous command I run

git clone git@bitbucket.org:uname/test-git-repo.git, I get the following weird error

error: cannot run /usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key
fatal: unable to fork

Can you please help me out solve this issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:46:03+00:00Added an answer on June 17, 2026 at 1:46 am

    You cannot provide options in the GIT_SSH environment variable; from the git man page:

       GIT_SSH
           If this environment variable is set then git fetch and git push will use this command instead of ssh when they need to connect
           to a remote system. The $GIT_SSH command will be given exactly two arguments: the username@host (or just host) from the URL
           and the shell command to execute on that remote system.
    
           To pass options to the program that you want to list in GIT_SSH you will need to wrap the program and options into a shell
           script, then set GIT_SSH to refer to the shell script.
    

    One option is to add a stanza to your .ssh/config file with the appropriate configuration:

    Host bitbucket.org
      StrictHostKeyChecking no
      IdentityFile /home/me/my_private_key
    

    Another option is to point GIT_SSH to a shell script that does what you want. E.g., in /home/me/bin/bitbucket_ssh, put:

    #!/bin/sh
    exec /usr/bin/ssh -o StrictHostKeyChecking=no -i /home/me/my_private_key "$@"
    

    And then point GIT_SSH at /home/me/bin/bitbucket_ssh.

    I prefer using .ssh/config when possible, because this avoids the need to create a per-destination script for each remote.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to clone my personal fork on github using the git+ssh protocol with
When trying to import my SVN repo in Git, using the following command: git
I am trying to clone a repo from an SSH remote like this: git
I'm trying to clone a remote git repo through ssh. When I try ssh
Currently I am trying to clone this git repo: https://github.com/twilio/OpenVBX into my main repo,
I'm trying to set up CC.net to build from my private Git repo. I
I'm trying to host a Git repo using Nginx 0.8.52, with fcgiwrap wrapping git-http-backend
I managed to clone GIT hub repo in Jenkins and now trying to build
I am trying to clone a git repo that I forked in my GitHub
$ git clone ssh://host/repo.git ~/ destination directory '/home/username/' already exists. Can anyone tell me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.