By default, permissions for
~/.ssh must be limited to the user in question. I don't think this has changed in the history of OpenSSH or its packages for Debian or Ubuntu.
This is controlled by
StrictModes documented in
man 5 sshd_config (for your versions in question, see Ubuntu 20.04 (Focal) docs vs Debian 9 (Stretch) docs). This section is identical between those two:
sshd(8) should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is
yes. Note that this does not apply to
ChrootDirectory, whose permissions and ownership are checked unconditionally.
My best guess is that your Ubuntu system has been configured to set
StrictModes no, which is strongly discouraged. I suggest changing it back to
It is best for
~/.ssh directories to be mode 0700 (
drwx------) and home directories to be writable only by their owners (so
~/.ssh isn't overwritten). I don't think the permissions on
~/.ssh/authorized_keys matter since only you and root can even see that it exists, but it's still best to keep at 600 (
-rw-------) or 644 (