Ubuntu Can Sign In to Google but Not GitHub? Here’s the Solution

Have you ever encountered a situation on Ubuntu where signing in with your Google account works perfectly, but attempting to sign in with your GitHub account fails or doesn’t respond as expected? You’re definitely not alone. Many Ubuntu users have faced this quirky behavior, often when trying to authenticate GitHub via a web interface, Git credential manager, or integrated services like GitKraken or VS Code.

This article dives into the underlying causes and offers you a clear and concise path to resolution. If Google works but GitHub doesn’t, it’s usually a permissions, environment, or security issue — and not something broken on GitHub or your machine itself.

Understanding the Root of the Problem

When Ubuntu allows you to sign in to your Google account but not GitHub, it may feel like your system is being selective. But here’s what’s actually at play:

  • Google Sign-In is often managed through your browser and system-level Google account management via GNOME Online Accounts.
  • GitHub authentication can involve HTTPS credentials, OAuth tokens, SSH keys, and API authentication — which is more complex than the Google flow.

The difference in authentication mechanisms, combined with additional security measures like two-factor authentication (2FA), can block GitHub sign-ins if not configured correctly.

Common Scenarios Where GitHub Sign-In Fails

To better diagnose your problem, determine when the failure occurs. Here are a few common situations:

  1. Trying to push code via Git and being prompted for username/password endlessly
  2. Attempting to log in to GitHub from apps like VS Code, GitKraken, or terminal tools
  3. OAuth GitHub login opens in browser but never completes

Each of these symptoms may indicate a different cause — from old credentials cached in your keyring to missing dependencies or outdated software.

Step-by-Step Solutions

1. Update Your System

First, ensure your Ubuntu software stack is up to date. Run the following commands:

sudo apt update && sudo apt upgrade

This ensures that any bugs in git, curl, or dependencies that handle TLS communication (important for GitHub!) are patched.

2. Verify Git Is Properly Installed

GitHub sign-in issues may stem from incomplete Git installations. Run:

git --version

If you’re not running a recent version, try:

sudo apt install git

3. Use GitHub Personal Access Tokens

GitHub disabled password authentication for Git operations in 2021. If you’re still using your username/password for Git, you’ll need a token instead.

Here’s how to fix it:

  • Go to your GitHub account settings.
  • Under Developer Settings > Personal Access Tokens, generate a new token.
  • Use this token instead of your password when prompted by Git.

Then configure Git with:

git config --global credential.helper store

This ensures your token is cached for future use.

4. Install Git Credential Manager Core

For a smoother login experience, especially in VS Code or GitHub CLI, install Git Credential Manager Core:

sudo apt install gcm

Then initialize it:

git-credential-manager-core configure

5. Clear Out Old or Broken Credentials

Your system might be trying to use outdated credentials. Clear them using this command:

git credential-manager-core erase

Or manually clear stored passwords from ‘Passwords & Keys’ if you’re using GNOME, then try signing in again.

Optional: Use SSH Authentication

If you prefer an alternative to web login or PATs, consider setting up SSH keys. This is ideal for users comfortable with the terminal:

  • Run: ssh-keygen -t ed25519 -C "your_email@example.com"
  • Add your public key to GitHub via Settings > SSH and GPG keys
  • Test with: ssh -T git@github.com

SSH is more stable over time and considered highly secure once configured.

Conclusion

Ubuntu’s friendly support for online services can make Google sign-ins seamless, but GitHub’s stronger security and requirements mean you may need to do some setup. Whether it’s switching from password credentials to Personal Access Tokens, installing Git Credential Manager, or properly configuring SSH, there’s a solution out there waiting to get you connected again.

Don’t let GitHub sign-in issues block your productivity — troubleshoot smart, and you’ll be up and coding in no time!