Situation: ssh-copy-id succeeds, but password still required to connect:
Triage:
To verify that the fingerprint of the local public key matches to a corresponding fingerprint in the remote ~/.ssh/authorized_keys file, run ssh-keygen -lf ~/.ssh/authorized_keys on the remote device, then ssh-keygen -lf ~/.ssh/id_<YOUR_KEY>.pub on the local device. There should be a match if ssh-copy-id succeeded.
Root Cause
The issue is not the key's content but the permissions of the key files. Those issues may exist on the remote or the local device.
Resolution
This script (written by Claude) will assert standard SSH configuration permissions for necessary files:
#!/usr/bin/env bash
set -euo pipefail
ssh_dir="$HOME/.ssh"
if [[ ! -d "$ssh_dir" ]]; then
printf 'Error: %s does not exist\n' "$ssh_dir" >&2
exit 1
fi
chmod go-w "$HOME"
chmod 700 "$ssh_dir"
# Normalize ownership of the SSH directory and its contents.
chown -R "$(id -un):$(id -gn)" "$ssh_dir"
# Normalize common SSH authentication files if present.
for file in authorized_keys; do
if [[ -f "$ssh_dir/$file" ]]; then
chmod 600 "$ssh_dir/$file"
fi
done
printf 'SSH directory permissions normalized for %s\n' "$USER"