User root can't write to file in /tmp owned by someone else in 20.04, but can in 18.04

To change the behavior back to the 18.04 default:

sudo sysctl fs.protected_regular=0  

See the accepted answer to

https://unix.stackexchange.com/questions/503111/group-permissions-for-root-not-working-in-tmp

Sigh, sometimes the cure is worse than the disease.


The root user should always be able to edit any and all files. The only correct response is to disable the sysctl fs.protected_regular setting until it gets fixed (i.e. so that root can edit anything on the system).

The other answer has a temporary solution that doesn't stick between reboots.

If you want to make the fs.protected_regular=0 change permanent between reboots, edit the /usr/lib/sysctl.d/protect-links.conf file.

Make the above change, then save and reboot to verify that it is working as expected.