I am new to Git hub and was able to successfully create an ssh key and upload it to the website however when I type in
git push origin master
I receive the following error:
error: cannot run ssh: no such file or directory
fatal: unable to fork
I am using Cygwin on a windows Vista machine if that is also useful. Ok.. after installing openssh I now get the error:
Permission denied (publickey)
fatal: the remote end hung up unexpectedly
You do not have ssh installed within Cygwin, or it's not in your path. Make sure that you are able to run ssh --version successfully from the Cygwin prompt.
For the second error, this indicates that the key your ssh client is attempting to authenticate with is not trusted by the remote server. Verify that the public key has been successfully added to your Github profile, and also verify that the public key you've added corresponds to the private key you are attempting to use.
you have to install openssh as well. Please re-run the cygwin setup and check openssh
Related
I'm using Windows Git-bash to push to my repository using ssh (not https). I have followed the instructions in this page
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
$ ssh-keygen -t rsa -b 4096 -C "barghouti_since88#hotmail.com"
$ ssh-add ~/.ssh/id_rsa
Then copied the key in ~/.ssh/id_rsa and copied it to my ssh keys in github account by following this setup
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
But now when I try to push using
$git add file
$git commit -m "adding file"
$git push
I'm getting the following
FATAL ERROR: Couldn't agree a key exchange algorithm (available: curve25519-sha256,curve25519-sha256#libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
There are a few possibilities you can examine:
did you "git clone" the repository with 'https' instead of 'git'? If
you want to git push with ssh, you need to clone with ssh as well.
is your Git for Windows version recent enough ? every once in a while, GitHub removes support for older, weaker, crypto, and your
software needs to match the server's algorithms, which in this case
it didn't, per the error message.
are you using the same ssh software as git ? Git for Windows comes with ssh included, but ssh can also have been installed separately,
on its own as OpenSSH, or included with putty, for instance. Compare
the output of 'where ssh-keygen' with the environment variable
GIT_SSH.
Hope this helps
I am tasked to set up a central GIT repo internally for my team.
I'm working on getting this setup on a Windows Server 2012 R2 machine. To the best of my knowledge I've set this up correctly.
I have been following this tutorial but they use CopSSH which isn't free anymore so instead I installed Windows OpenSSH here: Install-Win32-OpenSSH.
On our windows server I've installed and configured the Windows OpenSSH along with GIT. Made the appropriate changes with regards to the environment variables and references needed.
On my local system (also windows) I've installed Putty and generated my public and private keys. The public key has been copied to the server and placed in the correct file. Using putty, I have verified my public/private key authentication is working.
On the server I created a git bare repository in the C: drive like so:
cd C:\
mkdir testing.git
git init --bare testing.git
I installed GIT on my local machine and run the command:
git clone ssh://name#host:port/testing.git
I always end up with the output:
Cloning into 'testing'...
fatal: ''/testing.git'' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I've tried different variations of this command with the same results and moving the testing.git file to the user home directory (C:\Users\name):
git clone ssh://name#host:port/c/testing.git
git clone ssh://name#host:port/~/testing.git
I've messed with permissions to explicitly give permissions for this user to access that directory.
It seems as though, maybe the git clone command cannot find the folder on the remote server. I started thinking that the SSH server itself needed to be running in a unix like environment like cygwin. Is this my issue? I've seen tutorials/walkthroughs of installing cygwin with openssh and this would be my next attempt.
Thanks for any help!
EDIT:
So I went ahead and installed Bitvise with their 30 day trial (to try) and everything works but this is only for 30 days. So this must mean that there is some set up issue with the Windows OpenSSH that I have?
I have a git repo on BitBucket for a utility project and i use it as a git submodule in other projects. I wrote an Xcode Build Phase script that clones, initializes and updates the submodule but it fails cloning with this error:
Cloning into '[Location of my working copy]'...
ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
Permission denied (publickey).
fatal: Could not read from remote repository.
I can do a checkout from Xcode's interface, i can do a checkout from the command line, and i can even run the same script from the command line myself, and everything works, i get prompted for my passphrase. Except when the script is run by Xcode.
I contacted BitBucket support and they pointed it out that according to the error Xcode is trying to use /usr/X11R6/bin/ssh-askpass to prompt me for the passphrase of my private key but it can't find the file (i also found that /usr/X11R6 is just a symlink to /opt/X11). They suggested that i check the following links:
https://support.rstudio.com/hc/en-us/community/posts/200660237-Using-Git-with-password-authentication-on-OS-X
https://github.com/markcarver/mac-ssh-askpass
https://github.com/theseal/ssh-askpass
I installed the missing binary from the last link using Homebrew, symlinked it to the location Xcode needs it to be and got a seemingly broken dialog box:
I also tried copying the binary instead of symlinking but it didn't make a difference.
Any ideas?
Just to make sure i ran this test to see if there's a problem with my SSH configs...
$ ssh -vT git#bitbucket.org
...but according to the results everything is OK.
The guys over at https://github.com/theseal/ssh-askpass/ helped me figure this out.
I had to install the missing ssh-askpass then add my SSH key to the agent with ssh-add -c before Xcode was launched. Adding the key while Xcode was running resulted in the Build Phase script always returning an error:
sign_and_send_pubkey: signing failed: agent refused operation
You can read the troubleshooting details here.
When doing a git pull on a project with GIT tags, I get the error below.
I use msysgit on Win8, versions:
git-gui version 0.19.GITGUI
git version 1.9.5.msysgit.1
Tcl/Tk version 8.5.13
The error I get is:
$ git pull --tags
Enter passphrase for key '/c/Users/Me/.ssh/id_rsa':
fatal: Unable to create 'c:/Users/Me/someproject/.git/refs/remotes/origin/lpt1.2-support.lock': No such file or directory
fatal: The remote end hung up unexpectedly
Any clues?
I think the ssh couldn't find your keys. Make sure they are in the default location.
Try to clone the remote. If you are not able to clone and you get the message "The remote end hung up unexpectedly". We can suspect that the your ssh key is not in the default location.
If you are able to clone, and couldn't pull check if you have any locks and the directory exist on your local. c:/Users/Me/someproject/.git/refs/remotes/origin/lpt1.2-support.lock
On msysgit, check if the variable HOME is set. HOME can be set to any directory you want, you only have to make sure you have the right to write in it (and that the directory exists and a .ssh under it exists too).
ssh-keygen -t rsa
And follow the prompts there.
If the problem is solved could you please let me know which of the three cases above helped you.
When I run brew update I get the following error message
$ brew update
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
I am on OS X Yosemite.
GitHub isn't able to authenticate you. So, either you aren't setup with an SSH key, because you haven't set one up on your machine, or your key isn't associated with your GitHub account.