I have a fresh install of CentOS 6 that I am trying to connect to using ssh without a password.But each time I try to login, I am asked for the password.Here are the commands in order:ssh-keygenssh-copy-id -i ./id_rsa.pub user@192.168.1.20ssh user@192.168.1.20restorecon -r .ssh
Using passwordless ssh on CentOS 6
linux;ssh;centos;selinux
You should check the permissions of ~user/.ssh and particularly the owner.IIRC If the owner is root, user running restorecon cannot change it.You also should edit ~/.ssh/authorizedkeys as ssh-copy-id recommends and make sure that only the expected public key is in that file.(If that does not help, post ls -ld ~user/.ssh and ls -l ~user/.ssh)