github: No supported authentication methods available

前端 未结 16 690
挽巷
挽巷 2020-11-29 16:46

i use github and have successfully added and synched files on my laptop in the past.

as of recent i started getting \"PuTTY Fatal Error: Disconnected: No su

相关标签:
16条回答
  • 2020-11-29 17:04

    "... not sure what plink.exe or peagant.exe is ..."

    Since you ask: plink & pageant are part of the PuTTY suite, which is an implementation of SSH that supports Linux & Windows and is completely dominant on Windows.

    SSH

    Secure Shell (SSH) is a cryptographic network protocol for securing data communication. It establishes a secure channel over an insecure network in a client-server architecture, connecting an SSH client application with an SSH server. Common applications include remote command-line login, remote command execution, but any network service can be secured with SSH.

    if you ever used Telnet, it's like that (but more secure): it allows you to remotely access the bash shell (command line) of a Linux host.

    PuTTY

    PuTTY is a free and open-source terminal emulator, serial console and network file transfer application. It supports several network protocols, including SCP, SSH, Telnet, rlogin ...

    On Windows it's the dominant software for remotely accessing a Linux host's command line under the SSH protocol (above). In Windows, .exe extensions are for executables. So those notes about plink.exe & pageant.exe probably don't apply if you're in Linux. PuTTY includes

    Plink: a command-line interface to the PuTTY back ends

    Pageant: an SSH authentication agent for PuTTY, PSCP and Plink

    From (http://en.wikipedia.org/wiki/Secure_Shell#Key_management)

    When the public key is present on the remote end and the matching private key is present on the local end, typing in the password is no longer required ... for additional security the private key itself can be locked with a passphrase.

    So github is hosted on a Linux machine and uses SSH to secure the connection. SSH either authenticates with passwords or keys, many hosts (github?) only authenticate with keys. You setup is apparently trying to authenticate with a key. Keys and hosts are not one-for-one: you can have two keys for the same host and/or two hosts for the same key, so they need to be managed. If you are in Windows, then your SSH session is probably accessed through plink and your keys are probably managed by Pageant.

    Import the key you need each time you load Pageant. If you followed guides that said "import your key", and saw that it worked, but it doesn't work now, see Chapter 9: Using Pageant for authentication.

    One last tip if you are on Windows: you may have multiple instances of the PuTTY suite installed by various tools. TortoiseGit, for example, installs its own.

    0 讨论(0)
  • 2020-11-29 17:05

    For TortoiseGit Users on Windows

    Originally, I used to setup most of my Github/Bitbucket repositories using the SSH repository URLs as (originally) it used to be the only convenient way to prevent TortoiseGit from prompting for your password on every single action.

    But setting TortoiseGit up this way was always hair-pullingly painful. Every time it took me hours to set up correctly, as the default installation options never seemed to work (even as of 2016, sheesh!).

    But TortoiseGit now has better password management for HTTPS, and Github actually recommends using HTTPS URLs wherever possible.

    SSH URL: git@github.com:User/repo-name.git

    HTTPS URL: https://github.com/User/repo-name.git

    The benefits of HTTPS are:

    • No managing or generating of SSH keys
    • No need to have pageant.exe constantly running (which requests your password on each launch)
    • Using TortoiseGit from Australia, I find that clones over HTTPS are 5-10x faster than SSH
    0 讨论(0)
  • 2020-11-29 17:07

    My issue was that I was attempting to use my github username. Apparently when using Github (or is it a Git thing?), if you use key-based authentication, you need to set your username to git.

    I'm not sure why you even need a username at all - perhaps someone more knowledgeable can explain that?

    0 讨论(0)
  • 2020-11-29 17:07

    I got this problem (direct ssh worked, but git pull failed) due to my git remote not being what I thought it was.

    Yes, yes, I know it's a stupid mistake, but it happens and it's worth checking.

    Use git remote -v

    0 讨论(0)
  • 2020-11-29 17:14

    Same error, different solution noted here - Problem connecting to GitHub on Windows, even via PuTTY

    0 讨论(0)
  • 2020-11-29 17:16

    I experienced this problem because my GIT_SSH was pointing to the TortoiseSVN version of Plink.exe. I changed it to point to the TortoiseGit version, restarted cmd and it worked.

    I can't remember exactly, but the TortoiseSVN version might have been 32-bit version, and the TortoiseGit version was 64-bit (located in Program Files, not Program Files (x86)).

    Double-check your GIT_SSH env var.

    I prefer to use git with normal cmd.exe (in Console2 of course)

    0 讨论(0)
提交回复
热议问题