Upon rebooting my ubuntu machine remotely over ssh, I was no longer able to ssh to that machine. It was suggested that this was due to my home directory being encrypted with the authorized_keys locked inside it. So I took the same suggestion verbatim and added AuthorizedKeysFile /etc/ssh/.authorized_keys to my sshd_config.
But then I got Permission denied (publickey) on any ssh attempt including ssh localhost, with "Failed publickey for myusername from 192.168.1.8 port 63398 ssh2" in the /var/log/auth.log. The only way I found to fix this is to comment out the AuthorizedKeysFile setting (and maybe also do sudo service ssh restart). Of course this brings back my original problem with ssh-ing after reboot.
My /etc/ssh/.authorized_keys has permissions 600 just like the original ~/.ssh/authorized_keys. Any ideas what is going wrong?