The Username You Entered Is Already in Use. Delete the Response You Entered and Try Again

git@github.com: Permission denied (public cardinal).fatal: Could not read from remote repository. - It ways GitHub is rejecting your connection because -

  1. It is your private repo
  2. GitHub does not trust your figurer because it does non have the public key of your computer.

And when you endeavour to clone the repo you get the following error message -

                                          one                git@github.com: Permission denied                  (public key).                                                            2                fatal: Could not                  read                  from remote repository.                                                            3                                                                            4                Delight brand certain yous have the correct access rights                                                            5                and the repository exists.                                                    

Non only github but you can face up this upshot on the platform like GitLab, DigitalOcean, here I accept composed the listing of possible solutions -

  1. GitHub - How to gear up git@github.com: Permission denied (public key)?
  2. GitLab - How to gear up gitlab.com: permission denied (publickey) fatal: Could non read from remote repository
  3. BitBucket - Permission denied (public central), tin't clone/clone to bitbucket
  4. Personal Access Token - How to prepare(GitHub)-Back up for countersign hallmark was removed. Delight use a personal access token instead



1. GitHUb - How to fix this effect?

Step one - Create SSH key pair

One of the easiest means for you to generate a fundamental pair is past running ssh-keygen utility.

Open the command prompt and type in the following

(Note - If yous do not accept ssh-keygen installed on the window then Click hither.)

To keep the ssh-keygen simple, practise not enter any cardinal proper name or passphrase.

                                                            1                Generating public/private rsa primal pair.                                                                              2                Enter file in which to relieve the key                  (/Users/rahulwagh/.ssh/id_rsa):                                                                              3                Enter passphrase                  (empty                  for                  no passphrase):                                                                              four                Enter aforementioned passphrase once more:                                                                              5                Your identification has been saved in /Users/rahulwagh/.ssh/id_rsa.                                                                              6                Your public central has been saved in /Users/rahulwagh/.ssh/id_rsa.pub.                                                                              7                The cardinal fingerprint is:                                                                              8                SHA256:Okq3w+SesCGLQVToSBQru8RdUZtT2EIIrzH5MQ67DWA rahulwagh@local                                                                              ix                The fundamental's randomart paradigm is:                                                            10                +---[RSA 3072]----+                                                            11                                  |.ooo..+oo.                  |                                                            12                                  |                  oo o..o+.                  |                                                            13                                  |                  =                  Eastward                  =                  =                  +.                  |                                                            14                                  |*oo X o .                  |                                                            15                                  |.+                  =                  o  S                  |                                                            sixteen                                  |o.  + ..                  |                                                            17                                  |o ..+=+                  |                                                            18                                  |                  o + *++                  |                                                            nineteen                                  |. . o.+.                  |                                                            20                +----[SHA256]-----+                                                    

Where to find the fundamental pair

The file will be generated at - /Users/rahulwagh/.ssh/

Name of the file - id_rsa.pub

(To generate SSH keys on Windows machine click hither)


Stride two - Calculation SSH primal to your GitHub business relationship

  1. Goto your GitHub Business relationship -> Settings
Git hub account settings
  1. And so look for SSH and GPG keys under **Account Settings -> SSH and GPG keys **
github ssh and gpg keys
  1. After that click on New SSH Primal . Assign some meaningful proper name to your fundamental
GitHub new ssh keys
  1. To become the cardinal goto to your command prompt and switch directory path

Windows - C:\Users\rahulwagh.ssh\id_rsa.pub

Linux - /Users/rahulwagh/.ssh/id_rsa.pub

Run the following command

id_rsa_key content
  1. Copy the content of the key

  2. Paste the key within your GitHub account

Git hub account settings

Now yous tin clone your GitHub repo and information technology will not complain almost git@github.com permission denied (publickey). fatal could not read from remote repository


Benefits of this approach
  1. You practice not need to supply you GitHub Username and password
  2. More secured

Drawback
  1. The process of generating SSH keys is piffling troublesome.
  2. If you switch your laptop/desktop and then y'all need re-generate the SSH keys over again and perform the same steps onto your new laptop/desktop.


Approach 2 : Using GitHub HTTPS urls

This is one more than approach in which you practice not need to worry about SSH key generation.

You lot need following -

  1. GitHub repo URL with HTTPS (Ex - https://github.com/rahulwagh/instance.git)
  2. Your GitHub Username
  3. Your GitHub Countersign

Run the following control to fix git remote

                                          1                git clone origin https://github.com/rahulwagh/example.git                                                    

Subsequently that it volition ask for your username and password, supply your username and password.

Once you are authenticated and so you lot tin perform your Git operations.


Benefits of this approach
  1. You do not need to generate SSH keys
  2. You do not need to copy your SSH keys to GitHub accounts
  3. This approach can be used from any Laptop, Desktop. You lot only need to provide your GitHub credentials with this approach.

Drawback
  1. The only drawback which I can see is you demand to input your GitHub credentials everytime.


ii.1 Multiple public keys inside ~/.ssh directory?

When y'all are working with multiple github repositories and so there is high probability that you might take incorrect public key mentioned within your ~/.ssh directory.

For example I take generated the public primal for my GitLab projection by the name ~/.ssh/id_rsa.gitlab.pub

Simply when I checked my ~/.ssh/config file I noticed the incorrect name of public primal for the gitlab.com

Here is the content of my ~/.ssh/config file where the public key proper noun is ~/.ssh/id_rsa instead of ~/.ssh/id_rsa.gitlab.pub

                                          ane                Host gitlab.com                                                            2                                  Preferredauthentications publickey                                                            3                                  IdentityFile ~/.ssh/id_rsa                                                    

How to fix?

To fix this consequence yous should correct the public central proper noun -

                                          1                Host gitlab.com                                                            2                                  Preferredauthentications publickey                                                            3                                  IdentityFile ~/.ssh/id_rsa.gitlab.pub                                                    


3. Bitbucket - Permission denied (public central), can't clone/clone to bitbucket

There could be multiple reasons backside the issue -


3.1 You did not add together your local SSH keys to BitBucket Settings

SSH keys could exist 1 of the virtually probable reasons which are causing the upshot while working with your BitBucket repository.

You might see the following errors -

                                          ane                Permission denied                  (publickey).                                                    

or

                                          ane                abort: Permission denied:                                                    

or (In case yous are working with mercury and so y'all might run across this fault message)

                                          1                remote: Permission denied (publickey).                                                            ii                abort: no suitable response from remote hg!                                                    


How to fix?

Before we kickoff debugging the event, let's first debug the issue to know the exact reason backside this fault.

Run the following command from your terminal (put your right repository proper name) -

                                          one                ssh -T your_bitbucket_repo@domain.com                                                    

The to a higher place command should return you lot with Username and in case you did not see your username then you need to Create SSH keys and add to your BitBucket account.

Step 1 - Create your Public SSH Keys

Stride two - Goto Your Account -> Manage Account -> SSH Keys

Step iii - Click on Add Key

Stride 4 - Paste your fundamental which you take generated in Step ane.

Step 5 - Finally click on Add Primal

It should piece of work after adding the SSH keys to your BitBucket account.

(Note - Here are some official links from bitbucket if you are interested more - click here)



3.2 Permission on your bitbucket directory

There could also be a possibility that yous do non have permission to access the BitBucket repository. Bank check with your bitbucket administrator with regards to your permission.

If it is the case of permission then your bitbucket administrator could grant the permission.

1.i Generate ssh-keygen on Windows 10

If you are working on a windows motorcar then you need to install the OpenSSH.

Goto: Apps > Apps and Features > Manage Optional Features

Verify the listing of the apps, if it already installed. If not then go at the top of the page so select Add a Feature afterwords -

  • OpenSSH Client : Locate OpenSSH Customer, so click Install.
  • OpenSSH Server : Locate OpenSSH Server, then click Install.


Install OpenSSH using PowerShell on Windows 10

If you similar using Powershell then first make sure OpenSSH features are available to install -

Copy and run the post-obit command

                                          1                Get-WindowsCapability -Online                  |                  ? Proper name -like                  'OpenSSH*'                                                            2                                                                            3                                  # This should render the following output:                                                            four                                                                            v                Name  : OpenSSH.Client~~~~0.0.1.0                                                            six                State : NotPresent                                                            vii                Proper name  : OpenSSH.Server~~~~0.0.1.0                                                            viii                State : NotPresent                                                    

Afterwards that install server and client features using the following command -

                                                            1                                  # Install the OpenSSH Client                                                                              2                Add together-WindowsCapability -Online -Proper name OpenSSH.Client~~~~0.0.1.0                                                                              3                                                                                              4                                  # Install the OpenSSH Server                                                                              v                Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0                                                                              six                                                                                              7                                  # Both of these should return the following output:                                                                              8                                  `                                                                              9                Path          :                                                            10                Online        : True                                                            11                RestartNeeded : Faux                                                    

1.2 Verify OpenSSH client is installed
  1. Goto settings panel
windows setting console
  1. Click on Optional Features and then wait for OpenSSH client, if you can find the OpenSSH client which means you take installed information technology correctly.
windows setting panel
ane.3 Generate ssh keys on windows 10
  1. Next we need to run the ssh-keygen and for that goto window's command prompt and open information technology in ambassador fashion.
windows command prompt administrator mode
  1. In the command prompt type the following command
                                                            i                Generating public/private rsa key pair.                                                                              ii                Enter file in which to save the key                  (C:\Users\rahulwagh/.ssh/id_rsa):                                                                              3                Enter passphrase                  (empty                  for                  no passphrase):                                                                              four                Enter aforementioned passphrase again:                                                                              5                Your identification has been saved in C:\Users\rahulwagh/.ssh/id_rsa.                                                                              6                Your public fundamental has been saved in C:\Users\rahulwagh/.ssh/id_rsa.pub.                                                                              7                The central fingerprint is:                                                                              8                SHA256:Okq3w+SesCGLQVToSBQru8RdUZtT2EIIrzH5MQ67DWA rahulwagh@local                                                                              9                The cardinal's randomart image is:                                                            x                +---[RSA 3072]----+                                                            11                                  |.ooo..+oo.                  |                                                            12                                  |                  oo o..o+.                  |                                                            13                                  |                  =                  Eastward                  =                  =                  +.                  |                                                            fourteen                                  |*oo X o .                  |                                                            xv                                  |.+                  =                  o  S                  |                                                            16                                  |o.  + ..                  |                                                            17                                  |o ..+=+                  |                                                            18                                  |                  o + *++                  |                                                            nineteen                                  |. . o.+.                  |                                                            twenty                +----[SHA256]-----+                                                            21                                                                    


1.4 Where to find the cardinal pair

The file will exist generated at - C:\Users\rahulwagh.ssh\id_rsa

Proper noun of the file - id_rsa


4. How to prepare(GitHub)-Support for password authentication was removed. Please use a personal admission token instead

GitHub has recently announced their migration to use token-based authentication which ways yous can no longer use your username and password for GtiHub authentication. You lot need to create personal access token to proceed utilize of your GitHub Repository.

Here is my private GitHub repository which I was trying to clone and prompted with the error message -

Back up for password authentication was removed. Please use a personal access token instead

Before fixing the result lets attempt to sympathise how do you clone your Git Repo - https:// or git@github.com

This outcome is very much dependent on the way you clone your repository.

1. git@github.com:rahulwagh/jhooq.git - If you are using SSH way of cloning the repository and then you will not confront issue related to personal access token. Because when yous use SSH way of clonning so you should always create SSH Keys and copy public SSH cardinal to GitHub SSH and GPG keys

2. https://github.com/rahulwagh/jhooq.git - If y'all are using HTTPS manner of cloning the Git Repository then yous will be prompted with username, password and later entering the username and password you lot will exist thrown with fault Support for password authentication was removed. Please use a personal admission token instead


How to fix the personal access token for GitHub Repository

  1. Login to your GitHub account from the web browser.
  2. Goto -> Contour Pic -> Setting
personal access token settings
  1. Afterwards that you should await on the left navigation panel and there should be an selection of Developer Settings
personal access token settings developer settings
  1. Aftr that it volition redirect yous to the new page where you will discover an choice Personal Access Token in the left navigation. You should click on it -
personal access token click on the option
  1. Then next on the correct side of the screen yous take an pick to Generate New Token -
personal admission token Generate new Token
  1. Enter the token name along with the scopes -
personal admission token enter token name and scopes
  1. Finally Generate Token
  2. At present Copy the generated Token
personal admission token re-create generated token
  1. Go dorsum to last and re-issue the Git Clone command and instead of password input the access token
supply personal access token instead of GitHub password

It should prepare your issue of - "Support for password authentication was removed. Please use a personal access token instead"

Advantages of using Personal Admission Token

  1. Potent - The Personal Access Token are randomly generated cord which contains all possible combination of literal, number, upper case, lower case and special symbol. So it is really hard for animate being force attack.
  2. Meliorate Scoping - With personal admission token you can command the admission level at granular level.
  3. Multiple Personal Access Token - You tin can more and then ane personal admission token so that you practice not have to share countersign with anyone else.
  4. Revocable - You can easily revoke the admission to repository by deleting the personal access token.

goldsteinqualry.blogspot.com

Source: https://jhooq.com/github-permission-denied-publickey/

0 Response to "The Username You Entered Is Already in Use. Delete the Response You Entered and Try Again"

Mag-post ng isang Komento

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel