After initially setting up my CentOS boxes, getting everything installed and setup, copying from one server to another etc i like to get my
authorized_keys setup from my machine so i don’t need to keep entering the password.
SELinux is turned on by default after your install and for some reason doesn’t come with the authorized_keys configs initially installed.
Previously i’ve spent hours trying to figure out what was wrong with it and then had a ‘aha’ moment and realised it was SELinux that could be stopping it.
You could turn off SELinux but, its there for a reason and to flat out disable it isn’t the best thing to do (even though i know first hand how much of a pain it can be). If you don’t want to learn about SELinux then just disable it and your keys will no work (as long as you have the following security settings in place)
So; first of all make sure you have your
cd / mkdir .ssh chmod 700 .ssh