Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

If git clone works over HTTPS but fails over SSH, the repository is probably reachable; the SSH route is failing at a different layer. Check the SSH clone URL and the required git user, test authentication directly, verify that the selected key belongs to the account with repository access, then investigate host-key or port-22 errors. HTTPS success does not validate any of those SSH-specific conditions.

Why HTTPS can work while SSH fails

Git uses separate connection stacks for HTTPS and SSH. An HTTPS clone checks the repository path and the hosting service’s HTTPS authentication flow. An SSH clone must also parse an SSH-style URL, connect as the service’s SSH account, select a private key, complete public-key authentication, validate the server’s host key, and reach the SSH port. The authenticated account must then be authorized to read the repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A failure in any one of those stages can coexist with a completely successful HTTPS clone. The most useful troubleshooting method is therefore to identify the failing layer instead of repeatedly changing credentials or recreating the repository.

Use this diagnostic order

Work through the checks in this order. Each test narrows the problem without changing unrelated settings.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.
  1. Read the SSH remote URL and confirm its SSH user and repository path.
  2. Run a direct SSH authentication test, first normally and then with verbose output.
  3. If authentication is rejected, verify the private key, its public-key registration, and agent or configuration selection.
  4. Do not switch to sudo as a first fix; elevated and normal users have different key environments.
  5. If authentication succeeds but cloning fails, check repository authorization, spelling, and deploy-key scope.
  6. For a host-key error, verify the presented fingerprint before changing known_hosts.
  7. For a timeout or refusal on port 22, test the hosting service’s supported SSH-over-443 endpoint.

1. Check the SSH clone URL and login user

Inspect the remote that Git is actually using

From the repository directory, display the configured remotes:

git remote -v

Compare the SSH URL with the hosting service’s clone URL. A common GitHub form is:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
git@github.com:OWNER/REPO.git

An equivalent URL using the explicit SSH scheme is:

ssh://git@github.com/OWNER/REPO.git

Replace OWNER and REPO with the exact owner and repository names. Check capitalization, punctuation, renamed repositories, and organization ownership. A URL copied from an HTTPS button is not automatically a valid SSH URL.

Use git as the SSH account

GitHub requires remote connections to use the git user. Your GitHub personal username belongs in account authorization, not as the SSH login in the URL. For example, ssh://alice@github.com/OWNER/REPO.git is not the normal GitHub form; use git@github.com instead.

If you need to replace an incorrect remote, set it explicitly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
git remote set-url origin git@github.com:OWNER/REPO.git
git remote -v

Do not diagnose keys until this value is correct. A valid key offered to the wrong SSH user will still be rejected.

2. Test SSH independently of Git

Run the normal authentication probe

Test the host and account without attempting a repository operation:

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
ssh -T git@github.com

A successful result normally confirms authentication and notes that the account does not provide an interactive shell. That message is expected for Git hosting; shell access is not required for cloning.

Collect verbose connection details

If the probe fails, repeat it with verbose logging:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh -vT git@github.com

Read the output from top to bottom. It shows the host and port selected, the SSH configuration files read, identity files considered, keys offered, and the final authentication result. The final lines are more useful than the first warning: they distinguish a network connection that never formed from a server that rejected a key.

For an alias or nonstandard configuration, test the exact host name used by the Git remote. A successful probe against one alias does not prove that another alias selects the same key or port.

3. Fix Permission denied (publickey)

This message means the server rejected the public-key authentication attempt. The usual causes are an absent private key, the wrong key being offered, a public key not registered with the intended account, or an incorrect SSH user.

Confirm that the private key exists

Inspect your SSH directory and identify the private key that should be used. The private key stays on the computer; only its matching public key is uploaded to the hosting account. Do not paste a private-key file into an account setting or send it to another person.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the key is not in the default location, select it explicitly for a diagnostic test:

ssh -i ~/.ssh/KEY-FILE -vT git@github.com

Replace KEY-FILE with the actual private-key filename. If this command authenticates successfully while the plain ssh -T command does not, the key exists but automatic selection is wrong.

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Verify the matching public key is registered

Derive or locate the public key corresponding to the private key, then compare it with the key registered in the intended hosting account. GitHub’s SSH key setup requires adding the public key to the account before SSH Git operations can authenticate.

Make sure you are checking the account that should read this repository. Registering a key on a different personal account, organization account, or old account produces the same public-key denial even though the key itself is valid.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check the agent’s loaded identities

Many SSH clients ask ssh-agent for keys. List identities currently loaded in the agent:

ssh-add -l

If the intended key is absent, load it in the current user session:

ssh-add ~/.ssh/KEY-FILE

Run the verbose probe again and confirm that the intended identity is offered. An agent containing several keys can also cause the wrong account’s key to be tried first; an explicit -i test or a host-specific IdentityFile setting removes that ambiguity.

Make key selection deterministic with SSH configuration

For multiple accounts, create separate host aliases in your SSH configuration and assign each alias a key. The pattern is:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Host github-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_work
    IdentitiesOnly yes

Use the alias in the Git remote:

git@github-work:WORK-OWNER/REPO.git

Then test the same alias:

ssh -vT git@github-work

The important rule is consistency: the alias, key, account, and repository authorization must all describe the same identity. Keep each private key tied to the account for which its public key was registered.

4. Do not use sudo to hide a key problem

Running sudo git clone changes the user context. The elevated user may have a different home directory, a different .ssh directory, a different agent socket, and no access to the key that works for your normal account. A key created for your regular user is not automatically available to the elevated user.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Run Git and SSH as one consistent user and fix that user’s key configuration. If a system-level directory is required after cloning, perform only that separate file operation with the necessary privileges; do not use elevation as the authentication test.

5. Separate SSH authentication from repository authorization

When ssh -T succeeds but cloning fails

A successful SSH probe proves that the server accepted a key for an account. It does not prove that the account can read every repository. Recheck:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The owner and repository path in the remote URL.
  • Membership or read permission for the authenticated account.
  • Whether the repository was moved, renamed, made private, or deleted.
  • Whether the key is a deploy key attached to a different repository.

Deploy keys are repository-scoped credentials. A key that works for one repository can be denied for another, even on the same host. A “repository not found” response can indicate either a nonexistent path or a real repository for which the authenticated account has no permission.

Confirm which account the key represents

With multiple accounts, compare the key selected by ssh -vT with the public key registered on the account that has repository access. If the host authenticates you successfully but the wrong account is selected, correct the alias or IdentityFile rather than generating more keys at random.

Retest the exact clone operation

After correcting authorization or the path, run the same command the user needs:

git clone git@github.com:OWNER/REPO.git

A direct SSH test and a clone use the same host authentication but differ in the repository request. This final retest confirms that both layers now work.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Handle “Host key verification failed” safely

Host-key verification protects you from connecting to an unexpected server. The error concerns the server’s identity, not your repository password or public key. It can appear after a legitimate host migration, a changed network route, a rebuilt machine, or a stale entry in known_hosts; it can also indicate interception.

Inspect the stored entry

Find entries for the host in your known-hosts files:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
ssh-keygen -F github.com

For an explicit port-443 host, inspect that host name as well:

ssh-keygen -F ssh.github.com

Review the line and the fingerprint presented by the SSH error. Compare it with the hosting provider’s current, published host-key fingerprints through a trusted channel before accepting a change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change an entry only after verification

Do not blindly delete known_hosts or accept a new fingerprint merely to make the command continue. If the provider confirms the change, remove only the matching stale entry and reconnect so the verified key can be stored. A targeted removal command is:

ssh-keygen -R github.com

Use the equivalent bracketed host-and-port form when the conflict is specifically for a nonstandard port. Re-run the SSH test, check the displayed fingerprint, and accept it only when it matches the provider’s published value.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. Work around a blocked SSH port 22

Some firewalls and proxy networks refuse outbound SSH on TCP port 22. In that case, key configuration can be perfect while the connection times out or is refused before authentication begins.

Test GitHub’s SSH endpoint on port 443

GitHub documents an SSH-over-443 endpoint for networks that block port 22:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ssh -T -p 443 git@ssh.github.com

The hostname is ssh.github.com, not github.com. A successful response confirms that the network can reach the alternate endpoint and that your key still authenticates.

Clone with an explicit port

Use the ssh:// form when specifying a port:

git clone ssh://git@ssh.github.com:443/OWNER/REPO.git

Make port 443 transparent to existing GitHub URLs

Add a host rule to your SSH configuration:

Host github.com
    Hostname ssh.github.com
    Port 443
    User git

After saving it, keep using the normal-looking remote and retest:

ssh -T git@github.com
git clone git@github.com:OWNER/REPO.git

Corporate proxies can still interfere with SSH traffic even on port 443. This workaround is documented for GitHub.com; GitHub Enterprise Server does not support this particular endpoint, so enterprise administrators must provide an environment-specific route.

Error-to-action map

Observed symptom Most likely layer Next action
Permission denied (publickey) SSH user, key selection, agent, or account registration Run ssh -vT; confirm git as the user, the private key, its loaded-agent state, and registration on the intended account.
Host key verification failed known_hosts entry or changed server identity Inspect the matching entry and compare the presented fingerprint with the provider’s published fingerprint before modifying it.
Timeout or connection refused on port 22 Firewall, proxy, or network route Test the supported port-443 endpoint and configure ssh.github.com on port 443 if it succeeds.
Repository not found after SSH authentication Repository path or authorization Recheck owner and repository spelling, account access, and deploy-key scope.
Authentication works only for one account Multiple keys or SSH configuration selection Use verbose output, an explicit IdentityFile, or host aliases so each key maps to the intended account.

Choose the remedy by failure layer

Remedy Scope Security and portability considerations Access needed
Correct the SSH URL and git user One remote Low risk; works across operating systems and clients Local repository access
Register or select the correct key One account, or all repositories using that account Preserves key-based authentication; requires careful private-key handling Account settings and local key access
Fix repository permission or deploy-key scope One repository or organization Authorization change; may require an owner or administrator Repository or organization administration
Verify and repair known_hosts One host entry on one machine Highest caution: accepting an unverified key weakens server-identity protection Local SSH configuration; provider fingerprint information
Use SSH over port 443 All matching host connections on that machine Retains SSH keys where supported; proxies may still block it Local SSH configuration; enterprise support may differ
Use HTTPS as a fallback One remote or workflow Valid when network policy prevents SSH or the organization standardizes on HTTPS HTTPS credentials or token policy

What not to do

  • Do not replace git@github.com with your personal username.
  • Do not upload or disclose a private-key file; only the public key belongs in an account setting.
  • Do not keep generating keys without checking which identity SSH is offering.
  • Do not run Git with sudo merely because the normal user receives a key error.
  • Do not delete the entire known_hosts file or accept a changed host key without fingerprint verification.
  • Do not infer repository permission from a successful ssh -T response; test the repository path separately.

When HTTPS is the right fallback

HTTPS remains a legitimate solution if organizational policy disallows SSH, a proxy cannot pass SSH even on port 443, or the hosting service does not provide the alternate endpoint you need. Switching protocols does not repair SSH, but it can provide a supported workflow while an administrator addresses firewall rules, account authorization, or key policy. Keep the HTTPS remote only if its credential method meets your organization’s requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Final verification checklist

Before treating the problem as fixed, verify all of the following in one session:

  • git remote -v shows the intended owner, repository, host, and SSH user.
  • ssh -T (or the configured port-443 equivalent) authenticates the intended account.
  • ssh -vT shows the expected identity file or agent key being offered.
  • The matching public key is registered to an account that can read the repository.
  • No unverified host-key change remains in known_hosts.
  • The exact git clone, fetch, or pull command completes without a repository-not-found or authorization error.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.