Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git keeps prompting me for passphrase for my SSH Key - Ubuntu VM

I have a repo for my testing site in bitbucket

SSH

[email protected]:rkim/rkim-app.git

My current git config file

cat .git/config

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = [email protected]:rkim/rkim-app.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[credential]
    helper = store

git config --list

user.name=Ryan Kim
[email protected]
credential.helper=cache --timeout=3600
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
[email protected]:rkim/rkim-app.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
credential.helper=store

I've tried all the suggestions in here, and still got prompt to enter my passphrase.

git pull

Enter passphrase for key '/root/.ssh/id_rsa':

Let me know if anything else I can provide.

Can someone please put an end to this ?

Anythings elses, I should look into ?

Do I need to restart my SSH service or my VM ?

like image 564
code-8 Avatar asked Feb 01 '26 10:02

code-8


1 Answers

Git keeps prompting me for password

Enter passphrase for key '/root/.ssh/id_rsa': 

No, it is not password, but passphrase. How did you create that key? What are you trying to achieve?

I am trying to not enter the passphrase all the time. – ihue 30 secs ago

Then you have two possibilities. Remove the passphrase from the ssh key and you will never have to enter the passphrase again:

ssh-keygen -p -P old_passphrase -N "" -f ~/.ssh/id_rsa

Or temporary cache the passphrase somewhere. For this, there is ssh-agent, which can be started using

eval `ssh-agent`

and then you can add the key:

ssh-add ~/.ssh/id_rsa

You will be prompted once for the passphrase and then never again during your session.

like image 169
Jakuje Avatar answered Feb 03 '26 03:02

Jakuje