I added the public SSH key to the authorized_keys file. ssh localhost should log me in without asking for the password.
ssh localhost
I did that and tried t
I issued sudo chmod 700 ~/.ssh and chmod 600 ~/.ssh/authorized_keys and chmod go-w $HOME $HOME/.ssh from a previous answer and it fixed my problem on a CentOS 7 box that I had messed up the permissions on while trying to get Samba shares working.
sudo chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chmod go-w $HOME $HOME/.ssh