I have a remote machine with a single and root user - stg I connect to this machine using ssh stg@staging and run:
sudo chmod 777 .
i logout and cant connect any more:
Permission denied (publickey).
OpenSSH will not allow you to use key-based authentication if the rights of the user's directory and the .ssh directory therein are not secure. But you should be able to connect using your password. If that does not work either, I guess you disallowed password authentication in you