Here’s the prompt from ChatGPT, it summarises my issue quite well. I realised the issue before waiting for the answer, but still anyway. I guess I’ve transferred .ssh directory from my Arch Linux system by just copying files.
If your Fedora server is prompting you for a password instead of using your SSH key, there may be a few potential issues to check:
Permissions on the
.sshDirectory andauthorized_keysFile:- Make sure the permissions are correct. Your
.sshdirectory and theauthorized_keysfile must have the appropriate permissions to work properly:chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys - Also, make sure your home directory (
~) is not writable by others:chmod 755 ~
- Make sure the permissions are correct. Your
Ownership of Files and Directories:
- Verify that the ownership of the
.sshdirectory andauthorized_keysfile is correct. They should be owned by your user:chown -R yourusername:yourusername ~/.ssh
- Verify that the ownership of the
SSH Daemon Configuration (
sshd_config):- Check your
/etc/ssh/sshd_configfile to ensure the following lines are set correctly:PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys - If you made any changes, restart the SSH service:
sudo systemctl restart sshd
- Check your
SELinux Configuration (if enabled):
- If SELinux is enabled, ensure that the
.sshdirectory and files have the correct context:restorecon -R -v ~/.ssh
- If SELinux is enabled, ensure that the
SSH Client Configuration:
- Ensure your SSH client is using the correct key. You can specify the key explicitly:
ssh -i ~/.ssh/your_private_key user@yourserver
- Ensure your SSH client is using the correct key. You can specify the key explicitly:
Key Format and Content:
- Make sure your public key in
authorized_keysis in the correct format (a single line without any extra spaces or line breaks).
- Make sure your public key in
Check these steps and let me know if any issues persist.