|
EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
|
For enhanced security on Debian-based Linux distributions (like Ubuntu), it's best practice to run MeshCentral under a dedicated, low-privilege user account. This prevents the server from making unauthorized changes to the system.
⚠️ Important: Running with restricted privileges disables MeshCentral's self-update capability. Updates must be performed manually. Additionally, this setup requires using an external database (like MongoDB) because the primary data folder will be read-only.
Start by creating a system user named meshcentral. This user will be restricted from logging in and changing files outside its designated directory.
Next, create the installation directory and install the package using NPM.
Run the server once under the new low-privilege user to generate the necessary data folders and install any initial dependencies.
Once the server is running and the folders have been created, press CTRL-C to stop the process.
Now, set the ownership and permissions to ensure the meshcentral user has read-only access to the application code, enhancing security.
In a restricted environment, you need to explicitly grant write access to specific subfolders the server needs to modify during operation.
If you plan to use MeshCentral's file transfer features, the server needs to read and write to the meshcentral-files folder:
If you plan to use MeshCentral's built-in Let's Encrypt support, you must make its certificate folder writable to avoid ACCES: permission denied exceptions:
Because the meshcentral user lacks write access to the /node_modules directory, the server cannot update itself. To perform a manual update:
This process updates the server to the latest version on NPM and reapplies the strict permissions.