Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

`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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,721 views 4 12
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