Docker containers should have a non-root user by default
In the past, the OpenFOAM Docker CentOS containers used to have a non-root user, by default. Though the default password was not very obvious to the novice users like me. Although it is very much appreciated that the new Ubuntu-based images have root accessibility by default, without any passwords, when running blockMesh
command for example, as root, you will get the error message:
--> FOAM FATAL IO ERROR: (openfoam-2106) This code should not be executed by someone with administrator rights for security reasons. It generates a shared library which is loaded using dlopen
Now, there are of course instructions on cfd-online, to get a non-root user up and running, but believe me, if a potential user has to spend so much time configuration everything before running an actual calculation, many will give up. My suggestion is that please make two users, one root and one non-root, with some default passwords, and make them as obvious to the users as possible.
P.S. For those who end up here, instructions to create a non-root ofuser
:
adduser ofuser --disabled-password
passwd -d ofuser
adduser ofuser sudo
su - ofuser
more info here.