Reputation: 1
I'm facing an issue with SSH agent forwarding from my Windows 10 machine to a remote Ubuntu 20.04 server.
I followed the steps to enable and load my SSH key into the ssh-agent on Windows:
# By default the ssh-agent service is disabled. Allow it to be manually started for the next step to work.
# Make sure you're running [Powershell] as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Manual
# Start the service
Start-Service ssh-agent
# This should return a status of Running
Get-Service ssh-agent
# Now load your key files into ssh-agent
ssh-add ~\.ssh\id_ed25519
Then, I used ssh -A username@serverip
and established a connection without being prompted for a passphrase. On the remote machine, I confirmed that the forwarded key is loaded using ssh-add -l
, which shows:
256 SHA256:xxx xxx@xxx (ED25519)
However, despite the successful agent forwarding, I'm unable to clone my private GitHub repository in my remote server using the forwarded SSH key. The error I'm encountering is:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists
I think there's nothing wrong with the key since I could clone the project using this key in my local Window 10
Any suggestions or help ? Thank you.
Upvotes: 0
Views: 1347
Reputation: 1
So the problem turns out to be the default OpenSSH version installed in my local is outdated (8.1) and incompatible with the one in my remote machine. After upgrading to latest version, I could use the forwarded agent normally
I followed this guide to install latest OpenSSH for Windows
Upvotes: 0