Vscode: Bug: Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory

Created on 7 Aug 2017  路  22Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.14.2 (latest version)
  • OS Version: Mac OS Sierra (latest version)

Steps to Reproduce:

  1. Open up VSCode on OS X (Mac, ...)
  2. Configure a remote with password authentication (via terminal, f.ex. your own server with password ssh authentication)
  3. Click on "synchronize" button in VSCode in the lower left corner
  4. You will get an error message saying "Error: Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory".
  5. There only exists a directory named X11, but not X11R6 on OS X Sierra, so you would have to change the path, unfortunately this is not possible within the settings
  6. Nobody is able to upload files (push) to any password-protected server now (if he's using an OS X device)

Updating brew, installing the ssh-akspass package and starting the service didn't help.

The problem / bug seems to be only on OS X devices, haven't seen any reports about Windows so far.


Reproduces without extensions: Yes

bug git

Most helpful comment

In my case, it's caused by updating of mac OS, makes git lose passphrase of my ssh key. After ssh-add ~/.ssh/id_rsa, and REINSTALL vscode, this problem is fixed.

All 22 comments

Experiencing the same issue.
I have a git repository hosted on my own server runnig Debian v8.9 and git v2.13.2 on it.
I can access the repository with SourceTree without any issues, SSH-ing to server works, I have id_rsa.pub installed on the server, etc.

macOS Sierra 10.12.4 and VSCode Insiders installed yesterday.

screen shot 2017-08-08 at 02 39 52

I too can confirm this bug. Hosting my own internal git server on a Raspberry PI, which is configured to require a password on push. See this exact same error running OSX El Capitan and the latest version of VS Code, attempting to push from within the app.

Same error here trying to push from mac OS X 10.12.5 Sierra

Works via command line

Same issue, after updating to mac OSX Sierra.

Reinstall vscode fixed this.

In my case, it's caused by updating of mac OS, makes git lose passphrase of my ssh key. After ssh-add ~/.ssh/id_rsa, and REINSTALL vscode, this problem is fixed.

@shunia Thank you, though I don't think this can be the final solution, because it would mean that you would have to reinstall VSCode for every new ssh key. In my view, that's not acceptable. VSCode etc. should fix this.

In my case, I just downloaded and installed vscode and tried to use git pull from the vscode ui. I got the error Git: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory. The fix was to follow @shunia comment and run ssh-add ~/.ssh/id_rsa and then restart vscode. All is well now.

Wow, yes, this indeed seems to work. Which is pretty weird, because I set up everything beforehand to communicate between my computers and my server server through SSH via Terminal and also SourceTree, and that all worked a treat, no weird errors in聽SourceTree's "console" output.
Only VSCode has/had this issue here, but @shunia 's suggestion fixed this for me also, so thank you. 馃憤

Same issue here w/ High Sierra. @shunia solution did not work in this case. Note that this is for a project with a new key added to gitlab. I've not logged this machine into gitlab before. Also, by default, macOS doesn't have ssh-askpass as part of its arsenal, so I'm guessing that this is 'left over' from some git/*nix logic in the vscode git packages?

Indeed, if I manually clone via terminal,

photon:GitHub> git clone [email protected]:sleepyhead/sleepyhead-code.git
Cloning into 'sleepyhead-code'...
The authenticity of host 'gitlab.com (52.167.219.168)' can't be established.
ECDSA key fingerprint is SHA256:HbW3g8zUjNSksFbqTiUWPWg2Bq1x8xdGUrliXFzSnUw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.com,52.167.219.168' (ECDSA) to the list of known hosts.

now, everything works.

So it seems that the authenticity check raises an exception to the git handler in VSCode and, in response, it tries to spawn an "Is this OK?" check that doesn't exist on macOS.

@flipphillips I do think this is a bug or something goes wrong inside vscode, you pointed this out.
Hope vscode guys check this out quickly and fix it asap.

I've used command below to fix it:

$ brew tap theseal/ssh-askpass
$ brew install ssh-askpass
$ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass

Hope it will be helpful workaround.

@stargriv Do you use the latest Mac OS Sierra? I thought that there wouldn't exist such a folder named "X11R6". It should be renamed to "X11", I think (at least on my Mac that's the case).
Creating a directory named "X11R6" also didn't work for me; not even with sudo rights.

yup, can't create that folder. Is there a way to specifiy a folder to look for ssh-askpass

@welljsjs Yes, I'm using the Sierra too and I have /usr/X11R6, which points to /opt/X11.
I believe that /usr/X11R6 and /opt/X11 was created by XQuartz package, which I already had before.
Another solution which works for me is to manually add ssh keys with $ ssh-add command.

@stargriv Hmm, I just installed the latest XQuartz version and see - there now is a directory named "X11R6", but still no ssh-askpass although I installed it via homebrew.
I also found sth here:
https://support.apple.com/en-us/HT201341

Seems to work now - still not very as the user shouldn't have to do something like that.

@welljsjs Did you linked ssh-askpass with: $ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass after XQaurtz installation?

My steps that worked for me:

  1. Download xQuartz latest version : https://www.xquartz.org
  2. update and upgrade home-brew via 'brew update && brew upgrade'
  3. link: $ sudo ln -s /usr/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass as @stargriv described above :-)
  4. Start VSCode, should work now
  5. You still have to type in your password every time when you connect to the server; if you don't want that, create a ssh-key file.

I think the issue that we can't seem to create the X11R6 folder, even with root, so we can't create the symlink in the folder.

@tiny-cababge That's partly correct; see my comment above; the X11R6 folder definitely is created when you install the latest version of XQuartz. Then you're also able to create the symbolic link.

Another addition for those who are using ssh keys:
To avoid recurring password prompt asking your private key's password you can create .ssh/config in your home directory and add lines below:

Host *
    UseKeychain yes
    AddKeysToAgent yes

More information regarding Sierra and ssh agent here

To keep the number of issues in our inbox on a manageable level, we're closing issues that have been on the backlog for a long time but haven't gained traction: We look at the number of votes the issue has received and the number of duplicates issues filed.

It appears this issue already has a lot of workarounds, so let's rely on those!

Thanks for your understanding. Happy coding!

Was this page helpful?
5 / 5 - 1 ratings

Related issues

trstringer picture trstringer  路  3Comments

lukehoban picture lukehoban  路  3Comments

shanalikhan picture shanalikhan  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

trstringer picture trstringer  路  3Comments