So you created SSH keypair, installed public key on the server you want to connect to but, probably, made this not as described in this article: How To Set Up SSH Keys and now the server refuses your key and in /var/log/secure we can see message like this:
Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys
or
Authentication refused: bad ownership or modes for directory /home/user/.ssh
or
Permissions 0664 for '/home/user/.ssh/id_ed25519'
are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/user/.ssh/id_ed25519"
: bad permissions
Continue reading