sshd: Authentication refused: bad ownership or modes for directory /Users/Foo

I am trying to setup SSH Pubkey authentication. I've created a key on my client and copied the key to ~/.ssh/authorized_keys on the server. However, I still can't connect. I enabled logging as per

https://stackoverflow.com/q/43382825/7886229

and got

2021-04-13 09:40:33.045786-0400 0x3429629  Info        0x0                  3821   sshd: Authentication refused: bad ownership or modes for directory /Users/Foo

How can I fix this permission issue?


Solution 1:

I was able to fix the issue by resetting user permissions via the following command:

 diskutil resetUserPermissions / `id -u`