Step 1: Verify Your SSH Key
Check if you have an SSH key: Run:
ls ~/.ssh
Look for files named id_rsa
or id_ed25519
and their corresponding .pub files.
- If you don't have an SSH key: Generate one using:
ssh-keygen -t ed25519 -C "your_email@example.com"
Replace your_email@example.com
with the email associated with your GitHub account.
- Start the SSH agent:
eval "$(ssh-agent -s)"
- Add your SSH key to the agent:
ssh-add ~/.ssh/id_ed25513
Step 2: Add the SSH Key to Your GitHub Account.
- Copy your public key:
cat ~/.ssh/id_ed25513.pub
Copy the output.
- Add it to GitHub:
- Go to your GitHub SSH keys settings page.
- Click New SSH key, give it a title, paste the key, and save.
Step 3: Test Your SSH Connection
Run:
ssh -T git@github.com
If successful, you'll see a message like:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Step 4: Clone the Repository Again.
Retry cloning the repository:
git clone git@github.com:username/python-ecomerce-Api.git
Replace username
with the GitHub username owning the repository.
If the Issue Persists for not connecting to your account:
- Ensure that your SSH key matches the one added to GitHub
ssh-add -l
Confirm repository access by logging into GitHub and verifying your permissions.
If you're using a corporate network, check for any restrictions or firewall rules blocking SSH connections. Use HTTPS as an alternative:
git clone https://github.com/username/python-ecomerce-Api.git
Top comments (0)