If you’re having trouble getting SSH keys to work, then permissions may be to blame.
SSH will check permissions for the .ssh/authorized_keys files, the .ssh folder, as well as your /home/user folder before allowing authentication with keys. It makes sense because if other users could modify your .ssh folder and authorized_keys file, then they could insert their own public key and gain access to your account.
If you’ve set everything else up properly to enable SSH to authenticate via keys and it still won’t work, then check the permissions on your home and .ssh folders. If you’ve mucked them up somehow, then you can appease SSH by fixing them with these commands:
On the server:
chmod g-w /home/your_user chmod 700 /home/your_user/.ssh chmod 600 /home/your_user/.ssh/authorized_keys