question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Linux ssh-agent/ssh-askpass problem

See original GitHub issue

As already reported in #33814, #32097, #52137 the bug isn’t fixed for me and the workarounds don’t work either

VSCode Version: 1.26.1
OS Version: Ubuntu 16.04
Date: 2018-08-16T18:34:20.517Z
Electron: 2.0.5
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
Shell: zsh

Steps to Reproduce:

  1. Open a Git repo folder
  2. Call a Git action like sync, push etc

Does this issue occur when all extensions are disabled?: Yes

I’m using ssh-agent to keep all my keys opened and enter the passwords after I boot (ssh-add ~/.ssh/id_rsa). I can use git from the terminal without any problems, but “use the terminal then” is not a valid workaround for me when a whole feature doesn’t work. I’ve set some configs in my ~/.ssh/config file as well

Host *
  ServerAliveInterval 60
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa
Host gitlab.com
  HostName gitlab.com
  User git
Host github.com
  HostName github.com
  User git

But it still get this error when using a feature that calls a remote git action:

> git pull --tags origin master
ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists

I already tried installing ssh-askpass with sudo apt-get install ssh-askpass-gnome ssh-askpass but he asks me every single time for a password, so the ssh-agent is ignored

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:29 (7 by maintainers)

github_iconTop GitHub Comments

18reactions
sebtiz13commented, May 29, 2020

Hello i had same problems with Code - OSS on Manjaro

Version : 1.44.2 Validation : ff915844119ce9485abfe8aa9076ec76b5300ddd Date : 2020-04-23T19:32:05.786Z Électron : 7.1.14 Chrome : 78.0.3904.130 Node.js : 12.8.1 V8 : 7.8.279.23-electron.0 OS : Linux x64 5.4.40-1-MANJARO

I use Manjaro with KDE and he provide ksshaskpass i have simply create a symbolic link to his binary with and it’s work sudo ln -s /usr/bin/ksshaskpass /usr/lib/ssh/ssh-askpass

Screenshot_20200529_221133

I also tried openssh-askpass sudo ln -s /usr/bin/qt4-ssh-askpass /usr/lib/ssh/ssh-askpass

They are cool because may integrate better into the desktop environments.

In my tests only x11-ssh-askpass automatically create “/usr/lib/ssh/ssh-askpass”

Look the packages in your distribution i think you can find same packages

But i don’t understand why VSCode could not use ssh-agent to not ask password at each push/pull maybe an other bug because i haven’t this problems on windows

8reactions
joaomorenocommented, Aug 30, 2018

In our screen sharing session we figured out what was happening:

@derN3rd uses i3 with rofi. He launches code from rofi, which finds executables in the PATH. Code sets up the CLI launcher executable in the PATH, so rofi picks that one up. This is problematic since we never expected the CLI launcher executable to be launched in a non-shell environment, i.e. window managers. So, the CLI launcher behaves as if it was in a shell environment and doesn’t run our getUnixShellEnvironment . The result is a Code instance which never got the chance to execute (in this case) .zshrc. So, the SSH agent is improperly configured.

For a fix, we need to have a better way for whatever process we put in the PATH to detect whether it is already in an environment which was populated with the user’s RC files (whether it is a descendant of a shell process).

Read more comments on GitHub >

github_iconTop Results From Across the Web

The pitfalls of using ssh-agent, or how to use an agent safely
Well, your key will disappear, and the next time you try to use ssh it will simply prompt you for your password. That's...
Read more >
"ssh_askpass exec(/usr/libexec/openssh/ssh-askpass) no ...
"ssh_askpass exec(/usr/libexec/openssh/ssh-askpass) no such file or directory" error when I try to push in Git repo using VS Code ; Can you ...
Read more >
How can I solve this ssh-agent problem? - Unix Stack Exchange
The first thing I'd try is apt-get install ssh-askpass-gnome otherwise if you don't have that package (or some alternate askpass program) installed, ...
Read more >
Bug #1812247 “ssh-askpass(-gnome) fails for ssh-add -c
(2) This dialog is not ssh-askpass. So, if ssh-askpass is supposed to work it does not. Hence, `ssh-add -c` and key confirmations fail,...
Read more >
458694 – gnome-ssh-askpass no longer works
If you're using SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass then you get the dialog by doing something like ssh-add < /dev/null That's the non-gnome- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found