Resolution: Fatal:authentication failed for HTTPS

Source: Internet
Author: User
Tags git client git commands

Recent use of the Microsoft VSTS

Www.visualstudio.com

After the code is managed, the pull-replace code in the Linux environment is always validated unsuccessfully.

Workaround:

Use Git credential Managers to authenticate to VSTS
    • 2018/03/14
    • 2 min to read
VSTS | TFS 2018 | TFS 2017 | TFS 2015 | VS 2017 | VS 2015

GIT credential Managers simplify authentication with your vsts/tfs Git repos. Credential Managers Let's use the same credentials so you use for the VSTS/TFS Web portal and support multi-factor AUT Hentication through Microsoft account (MSA) or Azure Active Directory (AAD). In addition to supporting multi-factor authentication with VSTS, the credential managers also provide support Two-factor a Uthentication with GitHub repositories.

VSTS provides IDE support for MSA and AAD authentication through Team Explorer in Visual Studio, IntelliJ and Android Stud Io with the VSTS Plugin for IntelliJ, and Eclipse (with the Team Explorer Everywhere plug-in). If your environment doesn ' t has an integration available, configure your IDE with a Personal Access tokens or SSH to Conne CT with your to your repos.

Install The Git credential managerwindows

Download and run the latest Git for Windows Installer, which includes the GIT credential Manager for Windows. Make sure to leave the Git credential Manager installation option enabled when prompted.

MacOS and Linux

Review the system and software requirements before installing the Credential Manager.

On MacOS and Linux, there is several install options that use native package managers to install the Credential Manager. After installing the Your platform, run the following command to configure Git-to-use the Credential Manager:

> Git-credential-manager Install
Using The Git credential Manager

When you connect to a VSTS git repository from your git client for the first time, the Credential Manager prompts for your Microsoft account or Azure Active Directory credentials. If your account have multi-factor authentication enabled, you is prompted to go through that experience as well.

Once authenticated, the credential Manager creates and caches a personal access token for future connections to the repo. Git commands that connect to this account won ' t prompt for user credentials until the token expires or is revoked through Vsts/tfs.

Getting Help

You can open up and report issues with the Git credential Manager for Windows on the project GitHub. Frequently asked Questions for the Git credential Manager for Windows is available in the online readme.

Manual installation steps for the Windows Git Credential Manager and the MacOS and Linux git credential Manager is Availa ble. Use these steps to install the Credential manager if the recommended steps above is not a suitable for your environment.

Learn More

In addition to providing full source code, we've also documented how the Credential Manager integrates with Git. Refer to the MSDN blog posts on the MacOS and Linux Git credential Managerand the Windows credential Manager. There is also a article on the project GitHub with information on the low-level internals of the Git credential Manager F or Windows.

Feedback

Microsoft/git-credential-manager-for-mac-and-linux

Installation Instructions

This document explains how to obtain the GIT credential Manager for Mac and Linux (gcm4ml) and what to configure Git The GCM4ML as its credential helper.

System Requirements

Great care is taken to avoid using any features of Java, would impact compatibility with Java 6. If you find a compatibility issue, please report it and provide as many details on your platform as necessary to Reprod UCE the problem.

    1. Mac OS X version 10.9.5 and up OR a recent gnu/linux distribution.
    2. Java 6 and up.
    3. Git version 1.9 and up.
How to Install

On Mac OS X, installing via Homebrew is highly recommended. On Linux, it's recommended to use Linuxbrew or a rpm-based package manager if you can.

If You can also download Git-credential-manager-2.0.3.jar somewhere safe and St with any of the managers Able, such as ~/git-credential-manager/ , and then follow the instructions for automatic or manual configuration.

Installing on MAC using Homebrew or on Linux using Linuxbrew (recommended)
    1. Update the Homebrew/linuxbrew formulae to make sure the latest versions:

      brew update
    2. Install the GCM4ML formula:

      brew install git-credential-manager
    3. Run install The gcm4ml in mode, which would check its requirements and then update the "global" Git configuration file (The O NE in your home folder):

      git-credential-manager install
Installing on Linux using RPM (recommended)
    1. Download git-credential-manager-2.0.3-1.noarch.rpm and Copy the file somewhere locally.

    2. Download the pgp key used to sign the RPM.

    3. Import the signing key into RPM ' database:

        sudo RPM--import rpm-gpg-key.txt  
    4. Verify the gcm4ml rpm:

        RPM--checksig--verbose git-credential-manager-2.0.3-1.noarch.rpm  

      ... should see a line (among those there) that's equal to the following:

        V4 rsa/sha256 Signatur E, key ID ba34dbc2:ok  
    5. Install the RPM:

        sudo RPM--install git-credential-manager -2.0.3-1.noarch.rpm  
    6. Run the gcm4ml in  install  mode, which would check Its requirements and then update the ' Global ' Git configuration file (the one in your home folder):

        git-cred Ential-manager Install  
Installing on MAC or Linux without a package Manager

Download Git-credential-manager-2.0.3.jar somewhere safe and stable, such as~/git-credential-manager/

Automatic Configuration (recommended)
    1. Run install The gcm4ml in mode, which would check its requirements and then update the "global" Git configuration file (The O NE in your home folder):

      java -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar install
Manual Configuration
    1. Configure the credential.helper setting to launch Java and the absolute path to the JAR (make sure you surround the whole value with ' Single quotes '):

      git config --global credential.helper ‘!java -Ddebug=false -Djava.net.useSystemProxies=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar‘
How to enable alternate credential storage

On Linux, the GCM4ML stores credentials in the GNOME Keyring. If GNOME Keyring is unavailable for your Linux distribution, or you are running the gcm4ml via a secure Shell (SSH) Sessio N, a Git setting can be used to opt into storing credentials unencrypted in a file under your home directory where Presuma Bly only and root has read access.

To enable fallback storage of credentials in the this file, run this Git configuration command:

git config --global credential.canFallBackToInsecureStore true

With this setting, the gcm4ml would fallback to storing your credentials in this file:

~/.VSTeamServicesAuthPlugin/insecureStore.xml

How to enable (or disable) debug mode

Debug mode would turn on tracing and assertions, producing a lot of output to stderr . Only turn the temporarily, when trying to isolate a defect.

Automatic Configuration (recommended)
    1. Run the gcm4ml in mode with the property install debug set to true (or to false disable):

      java -Ddebug=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar install
Manual Configuration
    1. Retrieve the value of the credential.helper configuration:

      git config --global --get credential.helper git-credential-manager

      ... it should look like this:

      !java -Ddebug=false -Djava.net.useSystemProxies=true -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar
    2. Set a new value for the credential.helper configuration (essentially repeating the manual configuration installation step, be ing careful with quoting and spaces), changing the value of the debug "to true " (or to false disable).

How to configure the proxy server

If your network does not allow a direct connection to remote hosts, you can configure the GCM4ML to perform requests throu GH a Web proxy.

Automatic Configuration (recommended)

If you is running Gnome 2.x or greater, you can configure the proxy settings using the GUI and the gcm4ml would use those Settings thanks to a JVM feature that's activated by setting the system property to (this is now do java.net.useSystemProxies true Automati Cally when running the gcm4ml in install mode).

Manual Configuration

If it ' s not possible to use the automatic Proxy server configuration, you must set the appropriate networking properties. Aside from SOCKS proxy servers, which can has their credentials specified through specific properties, authenticated ProX Y servers is currently not supported.

  1. Retrieve the value of the  credential.helper  configuration:

      git config-- Global--get credential.helper git-credential-manager  

    ... it should look like this:

     !java -ddebug=false-djava.net.usesystemproxies=true-jar/home/example/git-credential-manager/ Git-credential-manager-2.0.3.jar  
  2. Set a new value for the credential.helper configuration (essentially repeating the manual configuration installation step, be ing careful with quoting and spaces), adding the appropriate properties. For example, if you have a proxy server so can do HTTP and HTTPS, running on the host 192.168.0.117 , listening on port 8123 , th En you would run the following (notice there's a pair of properties for HTTP and one for HTTPS).

    git config --global credential.helper ‘!java -Ddebug=false -Dhttp.proxyHost=192.168.0.117 -Dhttp.proxyPort=8123 -Dhttps.proxyHost=192.168.0.117 -Dhttps.proxyPort=8123 -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar‘
How to remove or uninstall

We are sad to see you go! Give us some feedback on how we could do better next time.

Uninstall from Mac using Homebrew or Linux using Linuxbrew
    1. Run uninstall The gcm4ml in mode, which'll update the "global" Git configuration file (the one in your home folder):

      git-credential-manager uninstall
    2. Uninstall the Git-credential-manager package with Homebrew/linuxbrew:

      brew uninstall git-credential-manager
    3. Archive the insecureStore.xml file from the git-credential-manager sub-folder under your HOME folder.

Uninstall from Linux using RPM
    1. Run uninstall The gcm4ml in mode, which'll update the "global" Git configuration file (the one in your home folder):

      git-credential-manager uninstall
    2. Uninstall the Git-credential-manager package with RPM:

      sudo rpm --erase git-credential-manager-2.0.3-1.noarch
    3. Archive the insecureStore.xml file from the git-credential-manager sub-folder under your HOME folder.

Automatic configuration removal (recommended)
    1. Retrieve the value of the credential.helper configuration:

      git config --global --get credential.helper git-credential-manager
    2. Run uninstall The gcm4ml in mode, which'll update the "global" Git configuration file (the one in your home folder):

      java -jar /home/example/git-credential-manager/git-credential-manager-2.0.3.jar uninstall
    3. The value retrieved in Step 1 contained the path to the JAR. You can go to delete that JAR.

    4. Archive the insecureStore.xml file from the git-credential-manager sub-folder under your HOME folder.

Manual Configuration Removal
    1. Retrieve the value of the credential.helper configuration:

      git config --global --get credential.helper git-credential-manager
    2. Delete the value of the credential.helper configuration:

      git config --global --unset credential.helper git-credential-manager
    3. The value retrieved in Step 1 contained the path to the JAR. You can go to delete that JAR.

    4. Archive the insecureStore.xml file from the git-credential-manager sub-folder under your HOME folder.

Resolution: Fatal:authentication failed for HTTPS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.