Important note on setting permissions on the server

Do not do chmod 777!
Don't easily chmod 777 authorized_keys or /var just because you get permission denied in scp!
After that, access will not be available.

You should look for other solutions. But I haven't found it yet.