VS Code - Git: key password requested. [HEAD SLAP - SOLVED]

Discussion in 'Developers' Forum' started by Chris_UK, Aug 6, 2021.

  1. Chris_UK

    Chris_UK Active Member HowtoForge Supporter

    Hi, using vs code to do a little development on ISPConfig.

    Yesterday after some tears tantrums and begging I finally managed to get things working, I was able to push a commit to my dev branch using ssh.

    Today however I was firstly prompted for the password the customary 3 times before failure, after a little digging I realised I may have set an incorrect host in .ssh/config on my local machine so the key wasn't being used.

    Changed host from gitlab.com to git.ispconfig.org

    Now it appears my key is not being accepted. So to the reason I am here.

    When creating a new key which I think might be needed what should the comment be set to? is it the account username, email or the commit email?

    Also: tested ssh -T [email protected] same result, key not accepted. Really not sure what I am missing here.
  2. Chris_UK

    Chris_UK Active Member HowtoForge Supporter

    Well as it seems in my many iterations of key generation I deleted the wrong pub key on git.ispc

    Note to self, when cleaning out "wrong" keys make sure they are indeed wrong.

    Anyway, all sorted.

    For anybody who has trouble with this.

    from your ubuntu terminal, adapt as required:
    git config --global user.name "git user name"
    git config --global user.email "[email protected]"
    ssh-keygen -t ed25519 -C "[email protected]"
    nano ~/.ssh/config
    add this:
    # Gitlab
    host git.ispconfig.org
     PreferredAuthentications publickey
     IdentityFile ~/.ssh/id_ed25519
    Get your pub key over to git.
    Copy the content of id_ed25519.pub either manually or:
    xclip -sel clip < ~/.ssh/id_ed25519.pub
    Head over to git.ispconfig.org

    Add a new email address if you have more than one:
    Otherwise just go to ssh keys and paste your public key

    Back to your terminal.
    ssh -T [email protected]
    You should see a success notice. if not, use -Tvvv to debug

Share This Page