Copying your SSH keys to a new server is usually accomplished by
ssh-copy-id [email protected]
However, on Fedora 40, I encountered the following error after adding my keys.
username@fedora:~/.ssh$ ssh hostname.com
sign_and_send_pubkey: signing failed for RSA "/home/username/.ssh/id_rsa" from agent: agent refused operation
This appears to just be a permissions issue. To fix this, use the following commands.
chmod 700 ~/.ssh
chmod 600 ~/.ssh/*