Where Do I Find Heroku SSH Key Pass? - heroku

Creating a new rails application, created a new Heroku app, and it is asking for my password after I type 'git push heroku master'; I cannot remember my password- how do I go about doing this to move forward in this tutorial?

Try using the Heroku password reset form if you've forgotten your password? https://id.heroku.com/account/password/reset

Related

when i am trying to login Heroku there is an message IP Address Mismatch [duplicate]

Previously I could sign into the heroku command line interface with heroku login. But now I get an IP address mismatch error. How should I resolve this?
Copy and paste heroku login -i in your terminal. This is what solved it for me.
Just adding some detailed steps to resolve the issue
Navigate to https://dashboard.heroku.com/account/applications
In Authorizations click on create authorization button
Add description in pop up eg.heroku cli and leave expire after blank if you dont want it to expire
You will get authorization token
in cli run heroku login -i
when it prompts for password enter the authoriation token
The accepted answer (run heroku login -i) doesn't work for accounts with MFA enabled. What I did instead was to reveal my account's API key and put it into ~/.netrc like so:
machine api.heroku.com
login <MY_EMAIL>
password <API_KEY>
machine git.heroku.com
login <MY_EMAIL>
password <API_KEY>
And voila! I can now use the CLI. This worked for me with Google CloudShell.
P.S. -- I added my machine's SSH key but could not understand how to use that to configure the CLI's access. It seems hard-coded to look for API keys in ~/.netrc.
If you are using Multi-Factor Authentication you could generate an Authorization token in settings page: https://dashboard.heroku.com/account/applications
Run heroku login -i and use the generated token as password.
If you're using a Mac running macOS 12 Monterey with the Private Relay feature enabled, you'll need to turn that off while you complete the Heroku CLI authentication workflow, since that feature is obfuscating your actual IP address by proxying your traffic through a pool of IP addresses.
For accounts that have MFA.
Run heroku login, press any key to open up browser window. Copy the url and open it in incognito mode.
This error will occur when your machine is behind a proxy if you disable the proxy temporarily then authentication will be done.
New changes where added by Heroku on login. You can find the change logs here.
In case if you are behind the firewall you may need to set the proxy.
set HTTP_PROXY=http://proxy.server.com:portnumber
If you are a Mac user on 12.3 or later, you need to open System Preferences, > Network > Wi-Fi, and then uncheck "Limit IP Address Tracking" for the duration of your authentication.
New OSX masks your IP address, and Heroku login doesn't know how to deal with it. All you need is to let Heroku verify IP before/after auth, and you'll be good to go.
for me heroku login -i worked..
didnt need the token.after heroku login -i it wanted my credentials...i.e email and password and i was logged in
If you're using Multi Factor Authentication you have to create an API key. To do that:
Go here: https://dashboard.heroku.com/account (login if asked)
Click here:
Open the hidden file located at ~/.netrc and paste your API key in the two 'password' fields.
For example, if your API key is 'a8g73nga-9vb2-0184-afbc-54fac2b66c75', then it should look like this:
machine api.heroku.com
login your.email#example.com
password a8g73nga-9vb2-0184-afbc-54fac2b66c75
machine git.heroku.com
login your.email#example.com
password a8g73nga-9vb2-0184-afbc-54fac2b66c75
The heroku CLI will now work!
Reference
Heroku CLI Authentication docs
This worked for me:
1/ Logout in the browser
2/ Clear cache and cookies for heroku.com (optional)
3/ Run "heroku login"
4/ Logging in the browser tab opened by the CLI
I initially installed Heroku with Snap software package manager.
Installing it with npm solved my problem.
copy and paste the code below.
npm i -g heroku
Close or switch terminal, and then rerun the command "heroku login" This works for me!
My default browser is Safari with private relay on. This was my issue. I just copied the url from the Safari browser to one of my other browsers (Brave) and it worked.
I was able to connect with the following:
heroku login -I //
email: user#email.com //
password: api key # from account settings
So satisfying!
For some reason heroku login -i led to some I/O issues on Google Colab for me.
I needed to press the return key multiple times after entering the password, and that somehow made the credentials incorrect.
I had to open up a Colab Terminal to login as I would via any Linux-based shell (The Colab terminal is available on Colab Pro and Pro+).
I had the same issue. I used heroku login. It worked.
I tried all the Solutions mentioned above but the VPN solved my issue.
I think i have a problem with my ISP or HTTP PROXY
HTTP_PROXY=http://proxy.server.com:portnumber

Heroku Login Multi-Factor Authentication mfa_required error (without opening a browser)

When using Heroku Multi-Factor Authentication, is there any way to login via the console without opening the browser?
ubuntu:~/environment $ heroku login -i
heroku: Enter your login credentials
Email [hello#gmail.com]:
Password: ****************
› Error: Your account has MFA enabled; API requests using basic authentication with email and password are not supported. Please
› generate an authorization token for API access.
›
› Error ID: mfa_required
Yes. Basically, to set this up what you want to do is:
Login to Heroku and create an API Token under "Account settings". (You said "without opening a browser", and I'm assuming you mean 'How to authenticate from the command-line'. To set this up you will need to open a browser ... once ;)
In your local machine's home directory, check to see if you already have a file called .netrc. If not, simply create one like so -- touch ~/.netrc.
From there you'll want to append the following to that file (and save):
machine api.heroku.com
login <your-email-goes-here>
password <the-api-token-goes-here>
machine git.heroku.com
login <your-email-goes-here>
password <the-api-token-goes-here>
If you just created the .netrc file you'll want to chmod 600 .netrc to give it necessary permissions.
At this point, you can try the command heroku auth:whoami and hopefully see your user e-mail printed back to you.
FWIW, Heroku does have some docs covering this here, but to be honest, the docs are rather disjointed and I would think unhelpful to someone that's never done something like this before, which is why I tried to go step-by-step.
I hope this is what you wanted and / or someone finds this helpful :)
For multi-factor authentication enabled heroku account, If you can get the API key then there is a simpler way to sign in via CLI. type -> heroku login -i
enter the email id associated with your heroku account and for password you must enter the API key that you got from the account settings page.

Git github not working with google authenticator OSX

So I had git running on my computer just fine. My password was saved with the osxkeychain thingy and everything ran smoothly. Today I decided I should be safe and enable google authenticator 2-step authentication on all the sites that support it. Interestingly github supports it so I set it up. It works fine through the website interface. I proceed to branch a project I'm working on and do a bit of work and then I try to push the new branch up. Not surprised at all when I find out my authentication doesn't work. What is surprising to me is that I can't seem to find anything at all on google to solve my problem.
my initial error was this:
git push --set-upstream origin binary-dev
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/***/***.git/'
I then purged my old password stuff to get the interactive prompt with:
git credential-osxkeychain erase
host=github.com
protocol=https
And that worked at getting rid of my old settings but now I get:
git push --set-upstream origin binary-dev
Username for 'https://github.com': ***
Password for 'https://***#github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/***/***.git/'
So git itself doesn't seem to know about the google authenticator. I literally can't seem to find any information on this. About half the pages are about how to set it up on the website and the other half are how to fork the actual google authenticator source code. I may not be creative enough with my keywords though. There may also be no solution but then I have to wonder why github offers 2-factor auth at all? Is there anyone out there who's been stuck here like me and has found a way out? Any help would be greatly appreciated. I just want git to work like it did before I added the 2-step auth to github.
Thanks in advance,
Max
So the way I got it working was to bypass the 2-step authentication using:
https://help.github.com/articles/providing-your-2fa-security-code#through-the-command-line
Thanks to "c4urself" over on serverfault.

Lost Heroku password, original email no longer exists to retrieve reset

I have lost my login password to my Heroku app. Also, the original email I signed up with no longer exists so I can't retrieve a reset email.
Can anyone suggest how I can get access to my account from the Heroku web site under these circumstances?
Thanks in advance.
If your Heroku CLI is still working against the old email I would suggest setting up a new Heroku account with a new email address. Add your new account as a collaborator via heroku sharing:add <newemail> and then transfer the app to the new email using heroku sharing:transfer <newemail>.
When you've transferred all your apps to the new email use heroku auth:logout and then heroku auth:login and use your new credentials.

How do I identify the username for my heroku token?

I have a terminal that's logged in to Heroku, but I'm not entirely sure under which userid. How do I check if it's me (as opposed to my coworker), so as to not clobber someone else's heroku app?
$> heroku auth:whoami
will show you who you are currently authenticated as.

Resources