di Windows 10-64bit
avevo installato git, quindi Heroku toolbelt (git che credo reinstallato)
ho avuto C\Program Files (x86)\Heroku\bin
nella mia variabile ambientale (probabilmente generato quando ho installato Heroku toolbelt) e se ho cercato in quel percorso file che avevo un ssh-keygen.bat - quindi sembrava che dovrei essere in grado di eseguire solo ssh-keygen -t rsa
dalla riga di comando.
che sarebbe troppo facile, invece ottengo:
C:\Program Files (x86)\Git\bin>ssh-keygen -t rsa -f id_rsa
'"C:\Program Files (x86)\Heroku\..\Git\bin\ssh-keygen.exe"' is not recognized as an internal or external command,
operable program or batch file.
Soluzione
tipo bash
nella riga di comando di andare in modalità bash git quindi eseguire ssh-keygen -t rsa
git bash:
[email protected] MINGW32 /bin
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/mamwo/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/mamwo/.ssh/id_rsa.
Your public key has been saved in /c/Users/mamwo/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:MMMYYYPPPUUUBBBLLIIICCKKEEEEYYYY [email protected]
The key's randomart image is:
Ora, quando guardo in C/User/mamwo/.ssh (il modo migliore per me è attraverso la cartella pycharms - windows sucks) vedo il mio id_rsa e id_rsa.pub
Ma questo problema "non può generare publickeys" è iniziato per me perché ho avuto un problema "Non ho le chiavi pubbliche da aggiungere" quando ho clonato il mio repository (da github) in un nuovo computer e ho scoperto che potrebbe spingere a github ma non heroku.
ora che ho le chiavi - devo aggiungere loro
C:\Users\mamwo\Desktop\mv>git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
C:\Users\mamwo\Desktop\mv>heroku keys
You have no keys.
C:\Users\mamwo\Desktop\mv>heroku keys:add
Found an SSH public key at C:/Users/mamwo/.ssh/id_rsa.pub
Would you like to upload it to Heroku? [Yn]
Vedere questa risposta precedente: http://stackoverflow.com/a/11771907/538746 –
@ user2098336 sarebbe molto importante scegliere la soluzione che ha risolto i tuoi problemi per aiutare altri programmatori che affrontano lo stesso problema in futuro! –