Terminal not working

Steven M.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 2, 2023

Hello,

I'm using the latest Sourcetree (new installed).

I've set up my SSH client configuration to use my pregenerated SSH key with PuTTY / Plink and all actions within the GUI work as expected.

But when I try to use the terminal, any git operation results in an error:

git fetch
git@hidden: Permission denied (publickey).
fatal: Could not read from remote repository.

I already tried to check my ssh-agent status, but it seems that it is not running or doing anything:

ssh-add -l
Could not open a connection to your authentication agent.

 Any ideas?

1 answer

1 accepted

0 votes
Answer accepted
Yasin August 2, 2023

 

I have been trying to share, let me try to send a screenshot

 

Ekran Resmi 2023-08-02 11.54.59.png

Steven M.
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 4, 2023

Hello Yasin,

Thank you. Setting up SSH Agent did not resolve the issue due to an invalid format. My old key was in format "PuTTY-User-Key-File-2":

Load key "privkey.ppk": invalid format

Opening the key with PuTTY Key Generator and choosing Conversions > Export OpenSSH key (force new file format) did the trick.

Now I have a new key file that can be used within the terminal using ssh-add

Additionally I had to set up a .bashrc for auto-starting the SSH agent upon starting the terminal (for the first time only):

export SSH_AUTH_SOCK=/tmp/.ssh-socket
ssh-add -l > /dev/null
if [ $? = 2 ]; then
    rm -f $SSH_AUTH_SOCK
    echo Starting new ssh-agent...
    eval $(ssh-agent -a $SSH_AUTH_SOCK) > /dev/null
    ssh-add ~/.ssh/privkey.ppk && echo "OK: ssh-agent set up successfully with the following keys:" && ssh-add -l
fi

Now my terminal is working correctly.

Best regards!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events