Resolving GitHub '403 Forbidden' Errors (HTTPS)
If you are trying to push code to a GitHub repository from a ruachost.com server and receiving a 403 Forbidden error, follow this guide to fix your authentication settings.
The Problem
When pushing changes using an HTTPS URL from your RuacHost terminal, you may see: error: The requested URL returned error: 403 Forbidden while accessing https://github.com/user/repo.git/info/refs
The Cause: GitHub no longer accepts your standard account password for Git operations. Additionally, some server environments on RuacHost require a specific URL format to trigger the authentication prompt correctly.
Method 1: The Modern HTTPS Fix (Recommended for Beginners)
To fix this, you must use a Personal Access Token (PAT) instead of your password.
Step 1: Generate your GitHub Token
-
Log in to GitHub and navigate to Settings → Developer Settings.
-
Select Personal Access Tokens → Tokens (classic).
-
Click Generate new token. Ensure you check the
reposcope. -
Copy the token. (You will not be able to see it again).
Step 2: Update the Remote URL on RuacHost
Log in to your RuacHost account via SSH, navigate to your project directory, and run:
# Verify your current remote URL
git config -l | grep url
# Update the URL to include your GitHub username
# Replace 'your-username' and 'your-repo' with your actual info
git remote set-url origin "https://your-username@github.com/your-username/your-repo.git"
Step 3: Push Using the Token
When you push your changes, Ruachost will prompt you for a password:
git push origin main
CRITICAL: When prompted for a Password, do NOT enter your GitHub login password. Instead, paste the Personal Access Token you generated in Step 1.
Method 2: The "Set and Forget" Fix (SSH)
SSH is often preferred for RuacHost servers because it avoids the need for tokens or passwords entirely.