ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
若执行以上步骤仍然无法成功ssh localhost
那么就是权限问题
chmod 0600 ~/.ssh/authorized_keys
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
若执行以上步骤仍然无法成功ssh localhost
那么就是权限问题
chmod 0600 ~/.ssh/authorized_keys