My host node is RHEL7 running KVM from the 'updates' repo. On the host node, the permissions for /dev/null
are:
crw-rw-rw-. 1 root root 1, 3 Dec 18 04:45 /dev/null
In an Alpine KVM guest (5.14, but same behavior on other versions), the permissions are missing the "others":
crw-rw---- 1 root root 1, 3 Dec 24 23:22 /dev/null
How can I persistently change the permissions in the guest to match the host? It is working OK on another node, but I can't see the difference between them.
There is no connection between host OS and guest OS regarding this.
It is Alpine Linux that assigns the permissions to the device node. They have had bugs related to this earlier: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_1.7.29.2
You need to check with Alpine Linux developers why the permissions are setup like that. Most likely it is related to their hardening efforts.
It seems this was caused by something in the Alpine setup process inside the KVM guest. It didn't occur when running the basic
setup-alpine
but did occur when doing a manual setup (e.g. custom disk partitioning).