Debug1: Authentications That Can Continue: Publickey

Should the sudo command or elevated privileges exist used with Git?

You should not exist using the sudo command or elevated privileges, such equally administrator permissions, with Git. If yous take a very good reason you must use sudo, then ensure yous are using it with every command (it'due south probably just better to use su to get a shell as root at that point). If you generate SSH keys without sudo and then try to utilise a control like sudo git push, yous won't be using the same keys that yous generated.

Check that you lot are connecting to the correct server

Typing is hard, we all know information technology. Pay attention to what you lot type; you won't exist able to connect to "githib.com" or "guthub.com". In some cases, a corporate network may cause issues resolving the DNS record equally well.

To make certain you are connecting to the right domain, you lot can enter the following command:

          $ ssh -vT git@github.com > OpenSSH_8.1p1, LibreSSL ii.vii.3 > debug1: Reading configuration data /Users/you/.ssh/config > debug1: Reading configuration data /etc/ssh/ssh_config > debug1: /etc/ssh/ssh_config line 47: Applying options for * > debug1: Connecting to github.com port 22.        

The connexion should be fabricated on port 22, unless y'all're overriding settings to apply SSH over HTTPS.

Always use the "git" user

All connections, including those for remote URLs, must be made as the "git" user. If y'all try to connect with your GitHub username, information technology volition fail:

          $ ssh -T            GITHUB-USERNAME@github.com > Permission denied (publickey).        

If your connection failed and you're using a remote URL with your GitHub username, you tin can modify the remote URL to use the "git" user.

You should verify your connection past typing:

          $ ssh -T git@github.com > How-do-you-do            username! Yous've successfully authenticated...        

Make sure you have a key that is being used

  1. Open Terminal Final Git Bash.
  2. Verify that y'all have a private fundamental generated and loaded into SSH.
                    # get-go the ssh-agent in the background $ eval "$(ssh-agent -southward)" > Amanuensis pid 59566 $ ssh-add -l -E sha256 > 2048                  SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ                  /Users/USERNAME/.ssh/id_rsa (RSA)              

If you have GitHub Desktop installed, you lot tin can utilize it to clone repositories and not deal with SSH keys.

  1. If you are using Git Bash, plough on ssh-amanuensis:

                    # start the ssh-agent in the background $ eval "$(ssh-agent -s)" > Amanuensis pid 59566              

    If you are using another terminal prompt, such as Git for Windows, turn on ssh-amanuensis:

                    # start the ssh-agent in the background $ eval $(ssh-agent -due south) > Agent pid 59566              
  2. Verify that you have a individual key generated and loaded into SSH.

                    $ ssh-add -l -E sha256 > 2048                  SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ                  /Users/USERNAME/.ssh/id_rsa (RSA)              
  1. Open up Last Terminal Git Bash.
  2. Verify that you have a individual key generated and loaded into SSH.
                    $ ssh-add -l -E sha256 > 2048                  SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ                  /Users/USERNAME/.ssh/id_rsa (RSA)              

The ssh-add command should print out a long string of numbers and letters. If it does not print anything, you will need to generate a new SSH central and associate it with GitHub.

Tip: On nearly systems the default individual keys (~/.ssh/id_rsa and ~/.ssh/identity) are automatically added to the SSH authentication agent. You shouldn't demand to run ssh-add path/to/key unless yous override the file name when you generate a key.

Getting more than details

Y'all can likewise check that the key is being used by trying to connect to git@github.com:

          $ ssh -vT git@github.com > ... > debug1: identity file /Users/you/.ssh/id_rsa blazon -1 > debug1: identity file /Users/you/.ssh/id_rsa-cert type -i > debug1: identity file /Users/you/.ssh/id_dsa type -ane > debug1: identity file /Users/you/.ssh/id_dsa-cert type -1 > ... > debug1: Authentications that can continue: publickey > debug1: Next hallmark method: publickey > debug1: Trying private key: /Users/you/.ssh/id_rsa > debug1: Trying private cardinal: /Users/you/.ssh/id_dsa > debug1: No more authentication methods to effort. > Permission denied (publickey).        

In that instance, we did not have any keys for SSH to use. The "-1" at the terminate of the "identity file" lines ways SSH couldn't observe a file to use. After on, the "Trying private key" lines also indicate that no file was constitute. If a file existed, those lines would exist "1" and "Offering public cardinal", respectively:

          $ ssh -vT git@github.com > ... > debug1: identity file /Users/you/.ssh/id_rsa type one > ... > debug1: Authentications that tin go along: publickey > debug1: Side by side authentication method: publickey > debug1: Offer RSA public key: /Users/you lot/.ssh/id_rsa        

Verify the public key is attached to your account

Y'all must provide your public key to GitHub to plant a secure connection.

  1. Open up Final.

  2. Beginning SSH agent in the groundwork.

                    $ eval "$(ssh-agent -south)" > Amanuensis pid 59566              
  3. Find and take a note of your public key fingerprint.

                    $ ssh-add -fifty -E sha256 > 2048                  SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ                  /Users/USERNAME/.ssh/id_rsa (RSA)              
  4. In the upper-right corner of whatever page, click your contour photo, so click Settings.

    Settings icon in the user bar

  5. In the "Access" section of the sidebar, click SSH and GPG keys.

  6. Compare the list of SSH keys with the output from the ssh-add command. SSH key listing in GitHub

  1. Open up the command line.

  2. Starting time SSH agent in the background.

                    $ ssh-agent -s > Agent pid 59566              
  3. Detect and take a notation of your public key fingerprint.

                    $ ssh-add together -l -E sha256 > 2048                  SHA256:274ffWxgaxq/tSINAykStUL7XWyRNcRTlcST1Ei7gBQ                  /Users/USERNAME/.ssh/id_rsa (RSA)              
  4. In the upper-right corner of any page, click your contour photo, and so click Settings.

    Settings icon in the user bar

  5. In the "Admission" section of the sidebar, click SSH and GPG keys.

  6. Compare the list of SSH keys with the output from the ssh-add command. SSH key listing in GitHub

  1. Open Terminal.

  2. Start SSH agent in the groundwork.

                    $ eval "$(ssh-agent -s)" > Agent pid 59566              
  3. Detect and accept a note of your public key fingerprint. If you lot're using OpenSSH 6.7 or older:

                    $ ssh-add -l > 2048                  a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d                  /Users/USERNAME/.ssh/id_rsa (RSA)              

    If yous're using OpenSSH vi.8 or newer:

                    $ ssh-add -fifty -E md5 > 2048                  MD5:a0:dd:42:3c:5a:9d:e4:2a:21:52:4e:78:07:6e:c8:4d                  /Users/USERNAME/.ssh/id_rsa (RSA)              
  4. In the upper-right corner of whatsoever page, click your profile photo, then click Settings.

    Settings icon in the user bar

  5. In the "Access" department of the sidebar, click SSH and GPG keys.

  6. Compare the list of SSH keys with the output from the ssh-add together command. SSH key listing in GitHub

If you don't encounter your public central in GitHub, you'll need to add your SSH cardinal to GitHub to associate it with your computer.

Alert: If you meet an SSH key you're not familiar with on GitHub, delete information technology immediately and contact GitHub Support, for further help. An unidentified public primal may indicate a possible security business concern. For more information, see "Reviewing your SSH keys."

hansonfroffelf.blogspot.com

Source: https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey

0 Response to "Debug1: Authentications That Can Continue: Publickey"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel