dev@local: ~/project — git
dev@local~/project$git clone [email protected]:user/repo.git
[email protected]: Permission denied (publickey).
fatal: permission denied publickey
Diagnostics Translation
The remote server rejected your SSH connection because it did not recognize your SSH key.
waiting for resolution...
MediumVersion Control System

Reviewed for reference consistency: April 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This failure points to SSH identity mismatch at the remote boundary: the server answered, but it did not accept the key presented by your client.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
The error occurred during a network exchange. Your local files are untouched, but Git cannot reach the remote server.

Commands That Trigger This

$git clone [email protected]:user/repo.git
Running on a new laptop
$Attempting to push code after your SSH key expired or was revoked
Attempting to push code after your SSH key expired or was revoked

Technical Background

01

This error is purely an SSH authentication failure, entirely separate from Git's internal logic or repository state.

02

Verifying the connection via SSH directly (e.g., `ssh -T [email protected]`) is the standard diagnostic step to isolate the issue from Git.

Underlying Causes

You haven't generated an SSH key on your local machine
You haven't uploaded your public key to your GitHub/GitLab account settings
The SSH agent is not running or hasn't loaded your private key

Frequently Asked Questions

No, your local Git repository is perfectly fine. Git is simply locked out of the remote server.

Related Git States