Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

`ssh-add -l` returning "Error connecting to agent: Bad file descriptor"

I have Googled this six ways to Sunday, but cannot find any answers for this particular issue.

What's killing me about this is that last week, this was working just fine! And now, this is happening. 

I open a Git Bash, and here's the 'log' of what happens.

.bashrc running...
in the if condition...
Initializing new SSH agent...
Identity added: /c/Users/Scott/.ssh/AqweevaBB_id_rsa (Scott@MALP04)
.bash_profile run and done.

Scott@MALP04 MINGW64 /c/Dev/Aqweeva/repos/netgcs_web_main_api (develop)
$ git status
On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean

Scott@MALP04 MINGW64 /c/Dev/Aqweeva/repos/netgcs_web_main_api (develop)
$ git ls-remote Permission denied (publickey).
fatal: Could not read from remote repository.

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

Scott@MALP04 MINGW64 /c/Dev/Aqweeva/repos/netgcs_web_main_api (develop)
$ ssh-add -l
Error connecting to agent: Bad file descriptor

So if anyone can tell me what to try next, I'd really appreciate it. (I've gone through all of the steps I can find for the `Permission denied (publickey)` error, and nothing seems to get rid of that dang Bad file descriptor error.)


1 answer

1 accepted

0 votes
Answer accepted

Well, apparently the path to the dang `ssh.exe` in my `.gitconfig` was pointing to a bad (perhaps out of date) EXE. I changed it to the actual Git for Windows version/instance and all is working again.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

61,869 views 127 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you