Skip to content

still unable to connect to github after generating password protected ssh key #169227

Discussion options

You must be logged in to vote

Hi @e55en,

The main issue is that when using SSH with GitHub, you should not be entering your GitHub username or passphrase at all during git push. Instead:

The SSH passphrase protects your private key locally — it’s not the same as a GitHub password or token.

If Git is still prompting you for a username/password, it means your remote URL is still using HTTPS instead of SSH.

Here’s how to fix it:

Check your remote URL:

git remote -v

git remote set-url origin [email protected]:username/repo.git

Now, if your key has a passphrase, you’ll only be prompted for that passphrase by your SSH agent — no GitHub username/password needed.

Extra tip: You can run ssh-add ~/.ssh/your_key so you don’t have t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@e55en
Comment options

Answer selected by e55en
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants