Unauthorized access to push to my GitHub account from Sandbox or vagrant box .I only push through Gitbash - vagrant

Please I'm working on a project that requires I must push my code to GitHub account through code sandbox or vagrant box. I can only push through Gitbash now. I reset my GitHub account password and even the access token yet it's still saying that I don't have access to push even after putting password/access token. I don't even want to talk about the commands that I've ran it all failed. Please where could this problem be coming from? I need help

Related

Getting "fatal: Authentication failed" -error when sending git commands in Windows 10

After updating domain password, accessing git-repo is no longer possible. VS Code and Source Tree as well as Visual Studio are returning the following error message on pull, push, fetch etc..
fatal: Authentication failed
Normally a credentials pop-up should appear however this is not happening. Also the common recommendation is not working:
git config --global credential.helper wincred
The password is stored in windows credential manager and needs to be updated. Open command prompt and enter the following command to view the list of stored passwords:
rundll32.exe keymgr.dll,KRShowKeyMgr
Scroll down in the list until you spot the git-related entries. Click it and edit the correct password.
VoilĂ !
I agree with Jesper, Other way to do is - On windows, if you can navigate to :
Control Panel\User Accounts\Credential Manager
Under Windows Credentials\Windows Vault page on Generic Credentials, you can update the password of existing GIT record or can also add new Generic Credentials.
Updated answer for Mac users :
In case if you're here with similar issue on Mac, you can do similar thing in keychain access - by deleting the existing GIT record, & then if you pass your credentials again in git bash or any other tool a new record gets created, things should work.
Try the following:
Click Start
Type: Credential Manager
See the Windows Credential Manager shortcut and double-click it to open the application.
Once the app is open, click on the "Windows Credentials" tab.
Locate the credentials that you want removed, they will start with "git:" and might begin with "ada:"
Click on the credential entry, it will open a detail view of the entry.
Click Remove and confirm removal when prompted.
I have experience a similar issue with Windows 10 and here's how I have solved it:
From Windows Search, type Credential Manager:
Open Credential Manager, and navigate to Windows Credential Tab:
You should see an entry for git credentials in Windows Credential Manager:
Here is the root cause, this git credentials is locally cached/saved to your local computer, and since we have changed our Active Directory password, it is currently out of synch.
Click Edit, and change this to your new/changed Active Directory password (this password has to match your new/changed Active Directory password) :
Note: This is for using git with https only, not for SSH: https://docs.github.com/en/free-pro-team#latest/github/using-git/which-remote-url-should-i-use
Save, it should work (does not require terminal or machine restart).
Lastly, if you do not have access to Credentials Manager (due to admin/security policy), you can force git to prompt for password by do a git pull from the specific repo by using username based repo url, e.g.
git pull https://{yourgitusername}#{gitrepo}.git
Note that, this is repo specific so you will have to do this each repo.
Good luck.
Nothing worked for me, even uninstall git and reinstall. What worked for me was to create a Personal Access Token from your github account and use that as the password. This page will detail the procedures: https://medium.com/#ginnyfahs/github-error-authentication-failed-from-command-line-3a545bfd0ca8
I faced the same issue and none of the above mentioned solutions did work. Finally I just removed git for windows and reinstalled the same without any credential managers. This solved the authentication issue with git.
Using Git for Windows (2.30.0), with the cross platform credential manager, with the remote set as a https GitHub address, to a public repository, doing git push by itself wasn't sufficient.
Instead I had to explicitly do git push origin main (replace main with master, or whatever your branch is) to have Git for Windows load a GitHub authentication page where I could authorize the application.
Creating a personal access token, as noted in another answer, was not necessary. Windows credentials were not present in Windows Credential Manager, but were added as Generic Windows Credentials via this method.
I had the same issue when Cloning the repository via Bash/VS Code with "fatal:Authentication failed". I used SSH Key authentication instead to connect my repository following the article: [https://learn.microsoft.com/en-us/azure/devops/repos/git/use-ssh-keys-to-authenticate?view=azure-devops&tabs=current-page][1]
I didn't get any errors after with any bash commands!
Above solution works only if your machine can SSH.
Try to manually remove setting
credential.helper=wincred from
C:\Users\<YOUR LOGIN>\.gitconfig file it it's there.
For me it helped after password change in LDAP.
Command to change setting didn't helped.
Honestly, what worked for me was installing the latest version of Git (2.36.1) to the day of this comment.
Happened the same: it stoped working after I changed the AD password. But it seems to be a bug in older releases.
This was a tip that Azure DevOps gave:
The only thing which worked for me was to remove the remote and add it back. I have tried deleting the credentials and even reinstalling the git the latest version. But the suggested way to access the remotes repos from Github and Microsoft DevOps is by using a shared key.
I was having the same problem and the best solution would be to insert whenever putting " git clone https://#praat.scm.azurewebsites.net:443/.git " [Insert after http:// your username and # ] and the cloning will work.

Connecting Heroku app to private GitHub repository for deploying on Heroku

I have an organization's private GitHub repository that I am trying to connect a Heroku app to, using the Heroku Dashboard from a browser. In the settings of my GitHub account (that is linked to Heroku), under OAuth Applications, I can see Heroku Dashboard, and under Permissions, it says Full control of private repositories.
However, when I navigate to the Heroku app page and select this GitHub repo from the select-list and click Connect, I get the message:
Item could not be modified:
Admin access to repository required
On GitHub, my account has Write access for the repo. Moreover, as mentioned above, Heroku Dashboard has Full control of private repositories. Can anybody help me figure out what access needs to be granted where? I would really appreciate that.
Never mind. That private GitHub repo had been created by someone else who had since left the company. I had Write access but that is not enough. When I created a new GitHub repo and an app on Heroku myself, I could connect them without any issues.
We had the same problem when someone without admin access to the github repo requested the github access in Heroku. He had to revoke his access in github before we could log back into Heroku with an account that had admin access in github and properly connect the accounts.

gem error on remote machine

I made a dashing app that queries the google api as part of its jobs. On my local everything works fine and I used git to clone the repo on a remote machine and ran bundle install there but when I try to run dashing start I get this error:
/home/mwerner/.rvm/gems/ruby-2.1.2/gems/signet-0.5.1/lib/signet/oauth_2/client.rb:941:in `fetch_access_token': Authorization failed. Server message: (Signet::AuthorizationError)
{
"error" : "invalid_grant"
}
I am using relative paths in the app so it can't be there is an authentication issue. I tried manually installing all the gems I use on the local machine on the remote machine via gem install ... but no luck. Hints?
I had the very same issue today. I got it resolved by checking back into my google developers account. In my case I had entered a wrong Mail address under service_account_email in the .rb file.
I inserted the data shown under "Client ID for Web Apps" where it had to be the one from "Service Account" out of my Google Developer API Account. Make sure you use Service Account Credentials for the widget!
Also I reassured that I had setup that very same address for read access in my google analytics account.
In short, getting that error means there is something wrong with the data you put in the analytics.rb file.
Once I did the above it resolved my issue and I was able to start dashing.

Host key verification failed Xcode with Mavericks Server

I'm trying to get a CI setup going and have got Mavericks server downloaded and linked with Xcode all on one machine.
Here's the set up:
Two git repos, hosted on OS X server, named CI and CISubmodule.
CISubmodule added as a submodule to CI
Every time I add bot I get a Host key verification failed error on integration. It's clear from the logs that the server is unable to clone CISubmodule due to an authentication error (I've tried SSH, HTTP, HTTPS) but I don't know why it's failing authentication.
I've set up the server so that logged in users can read and write.
I've tried everything mentioned here.
I'm guessing it's because the server is running as teamsserver and the repo is probably under my username, but I can't figure out how to give it permission to clone. Could it be that the SSH key requires a password? If so, how do I set it up so that it doesn't need a password any more?
Any guidance would be greatly appreciated.
Thanks,
Simon
I had the same case and I am not sure what happend exactly, I think the reason was I had more remote repository accesses and ssh keys pointing git-server side pointing to the same repository.
Deleting the remote repository accesses and cleaning up authorized_keys file helped.
I can confirm the CI server works with submodules, but make sure the .gitmodules file and xccheckout file point to the same repos
you may need to use passphrase-LESS keys for os x server to properly connect to 3rd party hosted git repos. it cannot connect with there is a passphrase needed.
ssh-keygen -p
it worked for us
One thing that helped me was to change my submodule URLs to use HTTPS instead of SSH.
When doing this, make sure that Xcode is actually using the new URLs. Even though I made the changes and pushed them, Xcode was caching the SSH URLs and using them. Remove all your SSH URLS from your server, then also remove them from your client under Preferences->Accounts. Then restart the server and restart Xcode, confirming that the new HTTPS URLs are being used when you create your bot.

Xcode5 bot cannot authenticate to git repo

I've set up a Mavericks box with OS X Server and Xcode 5.01. My source code is on a git repo that I have to access via https with a username and password.
In Xcode (on the same machine), I've cloned the project, built it and run it to check that all is fine. Then I've created a bot, selected the current server and scheme, and hit "integrate now". It fails after 5 seconds. I get:
Cloning into 'https_code_saers_com_myproject'...
fatal: could not read Username for 'https://code.saers.com': Device not configured
I checked that Xcode5 could pull new commits, so it has the username and password, yet by bot does not. Also, the "Device not configured" confuses me.
Any suggestion to how I can explicitly set the Username and Password?
Cheers
Nik
This may just be confusion in terminology, but the bot itself shouldn't be connecting to your repository. OSX Server does that. Before you can create a bot, you should've had to setup your repository in Server. When you do that, you get the opportunity to set username and password for accessing the repository.
It sounds like perhaps you have XCode configured to synch with your repository, but you must separately set up Server to access it as well. See the "XCode" tab in the Server app.
you may be running into the same problem we had- it was passphrase-protected keys. xcode + server + git cannot properly use passphrases on the keys.
thus, you must use a pashphrase-less key with os x server connecting to the git repo.
ssh-keygen -p
hope it helps.
edit: you might need to enable HTTP access to the git repo with this command:
git update-server-info # If planning to serve via HTTP

Resources