Debug ssh
From Do you speak Drupalish? Featured Drupal wiki-like documentation
LogLevel DEBUG3 in /etc/ssh/sshd_config via http://stackoverflow.com/questions/20864224/putty-getting-server-refused-our-key-error
- or ssh -vvv root@ip
- sometimes need to generate other key
up vote 8 down vote Adding a few thoughts as other answers helped, but were not exact fit. First of all, as mentioned in accepted answer, edit /etc/ssh/sshd_config and set log level: LogLevel DEBUG3 Then try to authenticate, and when it fails, look for log file: *or ssh -vvv root@ip from another machine /var/log/secure It will have errors you are looking for.
Could not open
- Check for debug1: Could not open authorized keys '/...../.permssion denied
selinux
- even permissions are ok, is selinux problem
- If the permissions are correct, SELinux might still be preventing sshd from opening the file. Try fixing the labels inside the .ssh directory (and maybe $HOME):
- restorecon -FRvv ~/.ssh
- (I'm intentionally not suggesting disabling SELinux or setting it to the permissive mode.)
- I had the same problem with the same cause, but restorecon didn't work. I had to change the SELinux type explicitly. chcon -Rv -t ssh_home_t ~/.ssh via http://stackoverflow.com/questions/20688844/sshd-gives-error-could-not-open-authorized-keys-although-permissions-seem-corre
- for sftp user and also for root
- Or chcon -Rv -t ssh_home_t .ssh ( for current directory)
[root@ssd176 ~]# chcon -Rv -t ssh_home_t .ssh changing security context of ‘.ssh/authorized_keys’ changing security context of ‘.ssh’
Also, check /etc/ssh/ssd_config to ensure that RSAAuthentication and PubkeyAuthentication options aren't disabled. Default is yes so that shouldn't be a problem.