Pushing an existing Heroku project from a new machine - deployment

I am trying to push a project to Heroku via "git push heroku" but keep getting the error "Your key with fingerprint XXXX is not authorized to access..." The project is already in existence and has been pushed multiple times from other machines." I already had an SSH key setup on this machine but when I added it via "heroku keys:add" I got the before mentioned error. Trying to start fresh, I've done the following:
heroku logout
heroku login (with my credentials that work on Heroku)
heroku keys:remove
heroku keys (shows no keys are there)
ssh-keygen -t rsa (to generate a new key)
heroku keys:add (successfully added newly generated key)
heroku keys (I see my added key)
Then after doing all this, if I run the "git push heroku" I still get the error message about my key not having access. I'm sure I'm missing something basic, but I cannot figure it out. Any help/guidance would be greatly appreciated.
Chris

Related

Unable to connect / clone GitLab repo in eclipse, even though able to connect to it from command line

I was trying to clone repository in eclipse from gitlab.
It was showing that I cannot checkout/commit repository unless generate ssh key pairs. It further gave me this link. I followed steps there. It created following files:
C:\Users\User Name\.ssh\id_rsa
C:\Users\User Name\.ssh\id_rsa.pub
Then I copy pasted public key back to GitLab.
Then ran this:
C:\Users\User Name>ssh -T git#xx.xx.xx.xx
The authenticity of host 'xx.xx.xx.xx (xx.xx.xx.xx)' can't be established.
ECDSA key fingerprint is SHA256:mZNjLhcagbXDWoshrvVT7wsMNbQ97UTGlJSfUsH6231.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'xx.xx.xx.xx' (ECDSA) to the list of known hosts.
Ubuntu 16.04.6 LTS
Enter passphrase for key 'C:\Users\User Name/.ssh/id_rsa':
Enter passphrase for key 'C:\Users\User Name/.ssh/id_rsa':
Welcome to GitLab, User Name!
So I feel I able to connect from command link.
However I am not able to connect in Eclipse.
I specified id_rsa file in eclipse as stated here.
Then I tried to clone repo in eclipse as follows:
But it keeps asking me password, without ever connecting:
My information in gitlab profile:
Email: user.name#domain.com
Name: User Name
User name: UserN
Whats wrong going on here? What I am missing / doing wrong?
PS: I have masked some text of repo URI and my username in 2nd image.
In first screen shot, when I put git instead of UserN for User, it worked. Afterwards it asked me password for id_rsa, which when provided, started cloning repository. Dont know why this worked. Can someone shed some light?

Cannot use git to clone in remote web server

I have created a Github repo to where I push my local changes using Git Bash, without any problems. I can also use Git Bash to connect to my remote web server (shared hosting) and navigate to the folder where I want to clone my Laravel site.
This is where the problems begin. When I do
$ git clone git#github.com:myusername/mylaravelsite.git
I get the error message:
Permission denied (publickey)
After some searching for a solution I found that I should make sure that I have a key by doing this:
$ eval "$(ssh-agent -s)"
Which gave this answer:
Agent pid 122372
Then according to the instructions I should do this
$ ssh-add -l
Which gave me this message:
The agent has no identities
Reading up a bit more I try to add the key again by doing
$ssh-keygen -t rsa
...which generated a key pair that I added with ssh-add, I was prompted for a passphrase which I entered twice.
Now, I still get Permission denied (publickey) when I try to access my github repo with ssh. I should also mention that I have created a new SSH key at the github account where I pasted the key I created (I opened .ssh/id_rsa-pub with notepad and copied the content).
What more can I try?
Finally found the answer in case anyone else has the same problem. It turns out that the public key also must exist in the remote web server (in the .ssh folder I uploaded the same rsa_id and rsa_id.pub files, that I created locally), not only locally and in the Github account.
Once I had figured that out and uploaded those files to the webserver, it worked to clone my github repo :-).

Failed to add the SSH key to the ssh-agent with an empty passphrase (Bitrise CLI)

Summary:
As I'm integrating CI to the development workflow, I'm also trying to move the executions of Bitrise workflows to our local iOS Mac Computer which is setup as a Jenkins slave.
The projects that I'm trying to build therefore needs to be built on this iOS Computer.
Problem:
I'm trying to establish an ssh connection to an integration user (a GitHub account that has access to my repositories) and I have created a key and added it to the GitHub user as well as to the .bitrise.secrets.yml file.
But when the initial step, the activate-ssh-key step is executed, it results with an error that I can't add the SSH key to the ssh-agent with empty passphrase. (Is this somehow configurable? Can I just evade this?)
Here is the output log:
https://pastebin.com/FCHhZNDb
Step in bitrise.yml:
- activate-ssh-key#4.0.2: {getenv "SSH_RSA_PRIVATE_KEY"}
.bitrise.secrets.yml:
envs:
- SSH_RSA_PRIVATE_KEY: ssh-rsa *KEY*
|------------------------------------|
I have also tried putting the ssh key directly in the .ssh directory which did not work.
Any help is really appreciated! :)
TL;DR
Trying to connect bitrise cli with github via ssh, doesn't work.
The SSH key you used seem to be protected with a passphrase. You should generate one that does not require a passphrase to be specified, and register that for the repository.
How to generate such an SSH key: https://devcenter.bitrise.io/faq/how-to-generate-ssh-keypair/
ssh-keygen -t rsa -b 4096 -P '' -f ./bitrise-ssh -m PEM
Alternatively you can replace the Activate SSH Key step with a script one and activate the SSH key any way you like.
Or if you prefer to not to use SSH keys you could switch to using https:// git clone urls (instead of the SSH / git# one) and replace the Activate SSH Key step with the Authenticate with GitHub OAuth one (https://www.bitrise.io/integrations/steps/authenticate-with-github-oauth).

GitLab + Eclipse + SSH - "Auth failed" or "cannot open git-upload-pack"

This week I set up an new GitLab server. It is running.
Yesterday I forced him to be reachable via HTTPS for secure communication.
In Eclipse I generated an RSA-Key via the preferences.
But if I try to import an Git-Project (git#DOMAIN:GROUP/PROJECT.git) then:
without password filled in, I got the response: Auth fail: Invalid password or missing SSH key.
with my password filled in (but git username), I got the response:
Auth fail: Invalid password or missing SSH key.
with my user & password, I got the response:
Auth fail: Invalid password or missing SSH key.
Via HTTPS I get the response:
cannot open git-upload-pack
Please, what do I don't see?
From my answer from here:
I faced the same issue while migrating my project from github to bitbucket and this is how I resolved it:
Introduction: I will describe the ssh key usage here. A user generates a unique key to connect to remote machines using ssh. So you can create it locally. After, user uploads the keys to the remote machines where want to connect without password and more securely. On Git, the same thing happens, user creates a ssh key and uploads the generated key value to the git system providers like Github or Birbucket. After uploading your unique key, you must configure your development environment to let your git system provider communicate providing security over ssh key.
1) I was using ssh key to push my commits to remote with github in eclipse, the ssh key is set at window -> preferences -> General -> Network Connections -> SSH2 for eclipse (on git pushes, this ssh key is used if set). If you do not have any ssh keys on your machine then follow this article to generate one for you and set it into eclipse at the path above.
2) In your github or bitbucke account, find the screen where you can save your ssh key. For bitbucket, it is at https://bitbucket.org/account/user/[user-name]/ssh-keys/. '[user-name]' here is your user name at bitbucket. Open your 'id_dsa.pub' file (where you generated your ssh key) with a text editor, select all, copy and paste into your github/bitbucket accounts' ssh key addition section and then click add.
3) At eclipse, be sure to use the 'ssh' GIT URI for your project. Go to Window -> Preferences -> Team -> Git -> Configuration, click 'Repository Settings' tab and paste your GIT ssh URI to remote.origin.url.
4) Finally try to push your commits to remote. You mustn't face any errors, if you have please comment under my answer.
Regards...
Recently, I did have similar issues with GitLab but fixed it with:
First, I generated the ssh-rsa by using the MAC-OSX CLI and exported to GitLab. Git CLIs were working but no luck from Eclipse.
Then, I went to Eclipse > Preferences... > General > Network Connections > SSH2, Key Management tab, I regenerated the key from Eclipse but using the "Generate RSA key..." button. It had "RSA-1024" at the end, and exported to GitLab.
https and ssh are two different communication protocols.
If you want to access your GitLab repos with https url, you should use https url:
https://yourLogin#DOMAIN/group/project.git
If you are using git#DOMAIN:GROUP/PROJECT.git, it is an ssh url.
Now: ssh cloning should work provided you have correctly setup your SSH id_rsa and id_rsa.pub in your Eclipse: see EGit SSH configuration.
Make sure:
your private key isn't password protected at first.
your public key (id_rsa.pub) is published on your GitLab profile

How to associate ssh key to heroku account in eclipse i am getting following error

i am new to heroku please help me .. :/
We have encountered a problem creating your application: intense-harbor-6816. This could be due to the Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account. To fix this error, you can: - Associate your SSH key to your Heroku account by going to "Preferences" OR - If the SSH Key is correct, restart Eclipse. git#heroku.com:intense-harbor-6816.git: session is down.
during cloning the application from heroku.
Please help me how can i fix it ..?
Try
ssh-keygen
and
heroku keys:add ~/.ssh/id_rsa.pub
and then see if this works
ssh -vT git#heroku.com
I was also facing Same error and was able to resolve this.
Please check this article to resolve it. Resolve Error : Eclipse SSH key is not matching the SSH key(s) that is associated with your Heroku account
Regards,
Jitendra Zaa