1
# MeshCentral Guide
2
3
-[MeshCentral Guide](https://meshcentral.com/docs/MeshCentral2UserGuide.pdf)
4
-
5
-MeshCmd Guide [as .pdf](https://meshcentral.com/docs/MeshCmdUserGuide.pdf) [as .odt](https://github.com/Ylianst/MeshCentral/blob/master/docs/MeshCentral User's Guide v0.2.9.odt?raw=true)
6
-
7
-## Video Walkthru
8
-
9
-<div class="video-wrapper">
10
- <iframe width="320" height="180" src="https://www.youtube.com/embed/D9Q7M7PdTg0" frameborder="0" allowfullscreen></iframe>
11
-</div>
3
+## 🧾 Abstract
4
13
-## Abstract
5
This user guide contains all essential information for the user to make full use of MeshCentral, a free open source web-based remote computer management software. The guide provides quick steps to setup administrative groups to remote control and manage computers in local network environments or via the Internet. Latter parts of the document will cover some advanced topics. The reader is expected to already have some of the basic understanding on computer networking, operating system and network security.
6
16
-## Introduction
17
-MeshCentral is a free open source web-based remote computer management software. You could setup your own management server on a local network or on the internet and remote control and manage computers that runs either Windows* or Linux* OS.
7
+## 📘 Introduction
8
+MeshCentral is a free open source web-based remote computer management software. You could setup your own management server on a local network or on the internet and remote control and manage computers that runs either Windows* or Linux\* OS.
9
19
-
10
+
11
12
To begin, a base or management server will be required. A management server could be any computing device (PC or VM) that has sufficient compute, storage and reliable network components to host an environment for MeshCentral and deliver good performance during remote management exercise. Whilst there are many configurations available for advanced users, typical server setup would only take just a few minutes to complete.
13
23
-At a high level, there are only four (4) main steps: Setup, Install, Connect and Control.
14
+At a high level, there are only four (4) main steps : **_Setup_**, **_Install_**, **_Connect_**, and **_Control_**.
15
+
16
+ 1. Setup the MeshCentral server on VM or PC
17
+ 2. Log on to MeshCentral portal with a valid account, creates an administrative mesh to collect all end-points (systems to be managed)
18
+ 3. Generates an agent and installs it on a target or each end-point that immediately attempts a connection back to MeshCentral server.
19
+ 4. Controls/manages assets or end-points that are available in respective administrative mesh
20
+
21
+## 🎬 Video Walkthru
22
25
-1. Setup the MeshCentral server on VM or PC
26
-2. Log on to MeshCentral portal with a valid account, creates an administrative mesh to collect all end-points (systems to be managed)
27
-3. Generates an agent and installs it on a target or each end-point that immediately attempts a connection back to MeshCentral server.
28
-4. Controls/manages assets or end-points that are available in respective administrative mesh
23
+<div class="video-wrapper">
24
+ <iframe src="https://www.youtube.com/embed/D9Q7M7PdTg0" frameborder="0" allowfullscreen></iframe>
25
+</div>
26
30
-## Server Installation
27
+## 🖥️ Server Installation
28
29
Because the MeshCentral server is written in NodeJS it can be installed on many operating systems including Windows, Linux. Please refer to the MeshCentral Installer’s Guide available at <https://www.meshcommander.com/meshcentral2> for information on how to install the server.
30
31
+---
32
+> **📌 Note:**
33
+
34
+> For information on how to install the server, please refer to the **MeshCentral Installer’s Guide** available at:
35
+> [https://www.meshcommander.com/meshcentral2](https://www.meshcommander.com/meshcentral2)
36
+---
37
+
38
The server can be installed both on a local area network for local computer management and in the cloud for management of computers over the Internet. You can also install it on small IoT devices like a Raspberry Pi all the way to big servers. It’s recommended to get started with a test setup to get a feel for this server. Once installed, come back to this document for configuring and using your new server.
39
36
-## Basic Usage
40
+## 🚀 Basic Usage
41
42
In this section we will cover the basics of MeshCentral in your newly setup server.
43
44
### Launch
45
42
-Start your web browser and access MeshCentral via IP address/URL, http://serverFQDN/. If MeshCentral is running locally, enter http://127.0.0.1/. MeshCentral will redirect the browser to HTTPS if the server was accessed with HTTP. Once on HTTPS you will likely see this message:
46
+Start your web browser and access MeshCentral via IP address/URL, `http://serverFQDN/`. If MeshCentral is running locally, enter `http://127.0.0.1/`. MeshCentral will redirect the browser to HTTPS if the server was accessed with HTTP. Once on HTTPS you will likely see this message:
47

48
49
This is because by default MeshCentral is using a self-signed certificate that is not known to the browser as a “trusted” or “trustworthy” certificate. To prevent this warning from recurring, the following chapter will provide useful steps that can be considered.
50
47
- To proceed on Firefox browser,
51
+---
52
+#### Proceeding with Browser Security Warnings
53
49
- - Click on “Advanced”, “Add Exception” and “Confirm Security Exception”
50
-
51
- To proceed on Chrome Browser,
52
-
53
-- Click on “Advanced”, “Proceed to <http://serverIP> (unsafe)”
54
-
55
-Note: You can also get to a device by specifying the device name in the URL by adding `?viewmode=10&gotodevicename=MyComputer` to the URL of the MeshCentral web page. The new `gotodevicename` will find a device with the specified name and navigate to that device’s page. This is perfect for integrating MeshCentral with other solutions but be aware that a computer name is not a unique identifier and so, `&gotonode=` is always the preferred way to access a device. This feature also works on the mobile web site.
54
+##### Firefox
55
+
56
+To continue on **Firefox**:
57
+
58
+1. Click on *Advanced*
59
+2. Select *Add Exception*
60
+3. Click *Confirm Security Exception*
61
+
62
+##### Chrome
63
+
64
+To continue on **Chrome**:
65
+
66
+1. Click on *Advanced*
67
+2. Click *Proceed to `http://serverIP` (unsafe)*
68
+---
69
+
70
+---
71
+> **📌 Note:**
72
+
73
+> You can also get to a device by specifying the device name in the URL by adding *`?viewmode=10&gotodevicename=MyComputer`* to the URL of the MeshCentral web page.
74
+> The new *`gotodevicename`* will find a device with the specified name and navigate to that device’s page.
75
+> This is perfect for integrating MeshCentral with other solutions but be aware that a computer name is not a unique identifier and so, *`&gotonode=`* is always the preferred way to access a device. This feature also works on the mobile web site.
76
+---
77
78
### Create Account
79
59
-Create an account by clicking “Create One” and click “Create Account” once the text fields had been populated correctly.
80
+Create an account by clicking “Create One” and click “Create Account” once the text fields had been populated correctly. As shown in the following image :
81
61
-
82
+
83
84
### New device group
85
91
92

93
73
-!!!note
94
+!!! note
95
There are two types of groups: <br>
75
- Software Agent Group: Commonly used to manage computers. Administrator must install a “remote management agent” on the remote computers. <br>
76
- Intel® AMT Agent-less Group: Exclusive for remote computers that has Intel® AMT activated and needs to be managed independent of a “remote management agent”.
96
+ - **Software Agent Group**: Commonly used to manage computers. Administrator must install a “remote management agent” on the remote computers. <br>
97
+ - **Intel® AMT Agent-less Group**: Exclusive for remote computers that has Intel® AMT activated and needs to be managed independent of a “remote management agent”.
98
99
### Add device
100
103
1. Click “Add Agent”,
104
2. Select the right Operating Systems (Windows* OS) and download the Mesh Agent executable.
105
3. Copy the Mesh Agent file into remote computers with Windows* OS
85
- 
106
+
107
+ 
108
4. Run Mesh Agent and Click “install”
87
- 
109
89
-!!!note
90
- Mesh Agent is available for Windows* and Linux*. For Windows*, the mesh agent doesn’t contain any sensitive data and can copied and reused on many Windows* computers. For Linux*, instead of an executable, an installation script is provided to add remote computers. The script checks the type of computer and installs the proper agent automatically.
110
+ 
111
+
112
+!!! note
113
+ Mesh Agent is available for Windows*\* and Linux*\*.
114
+
115
+ - *For Windows*\*, the mesh agent doesn’t contain any sensitive data and can copied and reused on many Windows* computers.
116
+
117
+ - *For Linux*\*, instead of an executable, an installation script is provided to add remote computers.
118
+
119
+ The script checks the type of computer and installs the proper agent automatically.
120
121
### After agent install
122
123
Once the agents are installed, it will take up to a minute before the computer shows up on the user’s account automatically. Click on each computer to access it and user can rename the each computer with a unique name and icons.
124
96
-
125
+
126
98
-
127
+
128
129
### Manage Computer
130
131
Click on any computer and go into the “Desktop” and “Files” tabs to remotely manage the computer or perform file transfer.
132
104
-
133
+
134
106
-
135
+
136
137
For advance users with console/command line interface experience, go into “Terminal” to perform scripting or quick tasks with CLI tools.
138
142
<iframe width="320" height="180" src="https://www.youtube.com/embed/alknFiojQPM" frameborder="0" allowfullscreen></iframe>
143
</div>
144
116
-Depending on how the agent is connected to the server, there are multiple methods to remote control. Mesh Agent, RDP, and AMT
145
+Depending on how the agent is connected to the server, there are multiple methods to remote control :
146
+
147
+- *Mesh Agent*,
148
+- *RDP*,
149
+- *and AMT*
150
151
For RDP connections, if you have previously saved the credentials that is usable by all users on the system. If you want to remove those saved credentials that's under the `General Tab` > `Credentials`. Click pen to clear them.
152
120
-## Server Certificate
153
+## 🔐 Server Certificate
154
155
As seen in the previous chapter, MeshCentral is setup with a self-signed certificate by default and the web browser will issue a warning concerning the validity of the certificate.
156
157
Users have few ways to handle this certificate warning:
158
126
-- Ignore the warning and proceed with an exception in a recurring fashion. However, traffic from the server to the web browser remains encrypted. User must check the validity of the certificate presented by the website and compare with “webserver-cert-public.crt” file in the “meshcentral-data” folder of the server.
159
+- Ignore the warning and proceed with an exception in a recurring fashion. However, traffic from the server to the web browser remains encrypted. User must check the validity of the certificate presented by the website and compare with `“webserver-cert-public.crt”` file in the `“meshcentral-data”` folder of the server.
160
- Add webserver’s root certificate into web browser’s trust list. Click on “Root Certificate” link at the bottom right of login page to download the root certificate of the web server and then add/import this as a trusted certificate into web browser. Some web browser may require a restart before the certificate installation takes effect.
161
- If you own a domain name that points to your MeshCentral server, you can get a free trusted certificate using Let’s Encrypt (https://letsencrypt.org/). See the section on Let’s Encrypt in this document for more information on this option. MeshCentral has built-in support for Let’ Encrypt.
162
130
-!!!important
131
- Before adding/importing the certificate, user must check the validity of the certificate presented by the website and compare with “root-cert-public.crt” file in the “meshcentral-data” folder of the server.
163
+!!! important
164
+ Before adding/importing the certificate, user must check the validity of the certificate presented by the website and compare with `“root-cert-public.crt”` file in the `“meshcentral-data”` folder of the server.
165
166
For large scale deployments or setup, a legitimate trusted certificate is highly recommended for your web server. This way, any web browser that navigates to this web server will be able to readily verify its authenticity.
167
135
-- If a legitimate trusted certificate is available, replace “webserver-cert-public.crt” and “webserver-cert-private.key” with your certificate. These files are located in “meshcentral-data” folder of the server.
136
-- If intermediate certificates are needed, add the files “webserver-cert-chain1.crt”, “webserver-cert-chain2.crt”, “webserver-cert-chain3.crt” respectively with the intermediate certificates.
168
+- If a legitimate trusted certificate is available, replace `“webserver-cert-public.crt”` and `“webserver-cert-private.key” with your certificate. These files are located in “meshcentral-data” folder of the server.
169
+- If intermediate certificates are needed, add the files `“webserver-cert-chain1.crt”`, `“webserver-cert-chain2.crt”`, `“webserver-cert-chain3.crt”` respectively with the intermediate certificates.
170
138
-**Note**: If you are using TLS offloading, see the section on “TLS Offloading” cover in the latter parts of this document.
171
+---
172
140
-## Files and Folder Structure
173
+> **📌 Note :**
174
+
175
+> If you are using TLS offloading, see the section on “TLS Offloading” cover in the latter parts of this document.
176
+
177
+---
178
+
179
+## 📁 Files and Folder Structure
180
181
It’s important to know the basic file and folder structure from which MeshCentral was installed as shown below
182
144
-
183
+
184
146
-Right after running the “npm install meshcentral” command, the node_module folder will be created which contains meshcentral and all of its dependent modules. When the server executes for the first time, both meshcentral-data and meshcentral-files folders will be created.
185
+Right after running the `npm install meshcentral` command, the node_module folder will be created which contains meshcentral and all of its dependent modules. When the server executes for the first time, both meshcentral-data and meshcentral-files folders will be created.
186
148
-!!!important
187
+!!! important
188
User must periodically backup both meshcentral-data and meshcentral-files which contains all of server’s data.
189
190
152
-The “meshcentral-data” folder will contain:
191
+The `“meshcentral-data”` folder will contain:
192
+
193
+- **`meshcentral.db`** :
194
+
195
+ The server’s database file which contains all of the user and computer information. This includes account information and other sensitive information.
196
154
-**meshcentral.db file**: The server’s database file which contains all of the user and computer information. This includes account information and other sensitive information.
197
+- **`Five .key and .crt files`**:
198
156
-**Five .key and .crt files**: These are the server’s certificates and private keys. They are used to securely identify the server. The .key files must not be obtained by anyone else since they could be used to impersonate the server.
199
+ These are the server’s certificates and private keys. They are used to securely identify the server. The .key files must not be obtained by anyone else since they could be used to impersonate the server.
200
158
-**config.json file**: This is the server’s configuration file. It first starts with a sample configuration that you can change. In a following section, we will discuss how to edit this file to customize the server.
201
+- **`config.json file`**:
202
160
-The “meshcentral-files” folder contains user files that have been uploaded to the server. This folder can be quite large, especially if no user space quota is set in the config.json file. Users can upload a significant amount of files on the server.
203
+ This is the server’s configuration file. It first starts with a sample configuration that you can change. In a following section, we will discuss how to edit this file to customize the server.
204
162
-!!!important
205
+The `“meshcentral-files”` folder contains user files that have been uploaded to the server. This folder can be quite large, especially if no user space quota is set in the config.json file. Users can upload a significant amount of files on the server.
206
+
207
+!!! important
208
Back-up the “meshcentral-data” folder since this is the folder needed to reconstruct the server if something goes wrong. Without it, user will to start over. Recommended to apply suitable encryption on both folders given that they contain sensitive data.
209
165
-## Server Configuration File
210
+## ⚙️ Server Configuration File
211
212
In the “meshcentral-data” folder, there is a file called config.json that contains the main configuration of the server. A sample configuration file could look like this:
213
169
-```
214
+```json
215
{
216
"settings": {
217
"cert": "mesh.myserver.com",
242
}
243
```
244
200
-First, we will look at each of the top levels of the configuration file. The tops levels are “settings”, “domains”, “peers”, and “smtp” as shown in the table below.
245
+First, we will look at each of the top levels of the configuration file. The tops levels are `“settings”`, `“domains”`, `“peers”`, and `“smtp”` as shown in the table below.
246
202
-
247
+
248
249
### Settings
250
206
-As indicated before, the settings section of the config.json is equivalent to passing arguments to the server at runtime. Below is a list of settings that are available for the user.
207
-
208
-| Settings Option | Description |
209
-| --------------- | --- |
210
-| Cert | Sets the DNS name of the server. If this name is not set, the server will run in "LAN mode". When set, the server"s web certificate will use this name and the server will instruct agents and browsers to connect to that DNS name. You must set a server DNS name to run in "WAN mode". MeshCentral will not configure your DNS server. The DNS name must be configured separately. |
211
-| Port | This sets the main web port used by the MeshCentral server and it"s the same port that users and mesh agents will connect to. The default port is 443, but if the port is busy, the next available higher port is used (.e.g. 444) |
212
-| AliasPort | Sets the main port that will be used by the server externally. By default is the same as "Port" above, but can be set to be different when next. See "Server port aliasing" section for more details. |
213
-| RedirPort | This is the port for redirecting traffic in the web server. When the server is configured with HTTPS, users that uses HTTP will be redirected to HTTPS. Port 80 is the default port. So, redirection will happen from port 80 to port 443. |
214
-| MpsPort | Port for Intel" AMT Management Presence Server to receive Intel" AMT CIRA (Client Initiated Remote Access) connections. The default is port 4433. This port is disabled in LAN mode. If user don"t plan on using Intel" AMT for management, this port can be left as-is. |
215
-| TLSOffload | By default this option is set to "false". If set to "true", server will run both web port and the Intel AMT MPS port without TLS with the assumption that a TLS offloading is taking care of this task. For further details, see the "TLS Offloading" section. This option can also be set to the IP address of the reverse-proxy in order to indicate to MeshCental to only trust HTTP X-Forwarded headers coming from this IP address. See the "Reverse-Proxy Setup" section for an example. |
216
-| SelfUpdate | When set to "true" the server will check for a new version and attempt to self-update automatically a bit after midnight local time every day. If set to a specific version such as "1.1.21" the server will immediately update to the specified version on startup if it's not already at this version. |
217
-| SessionKey | This is the encryption key used to secure the user"s login session. It will encrypt the browser cookie. By default, this value is randomly generated each time the server starts. If many servers are used with a load balancer, all servers should use the same session key. In addition, one can set this key so that when the server restarts, users do not need to re-login to the server. |
218
-| Minify | Default value is 0, when set to 1 the server will serve "minified" web pages, that is, web pages that have all comments, white spaces and other unused characters removed. This reduces the data size of the web pages by about half and reduced the number requests made by the browser. The source code of the web page will not be easily readable, adding "&nominify=1" at the end of the URL will override this option. |
219
-| User | Specify a username that browsers will be automatically logged in as. Useful to skip the login page and password prompts. Used heavily during development of MeshCentral. |
220
-| NoUsers | By default this option is "false" and if set to "true", server will only accept users from localhost (127.0.0.1) and will not have a login page. Instead, a single user is always logged in. This mode is useful if user opts to setup MeshCentral as a local tool instead of as a multi-user server |
221
-| MpsCert | Specifies the official name of the Intel AMT MPS server. If not specified, this is the same as the official server name specified by "cert". This option is generally used with MPS aliasing, see the "Server port aliasing" section for more information. |
222
-| MpsAliasPort | Specify an alias port for the MPS server. See the section on "Server port aliasing" for use of this option.
223
-| ExactPorts | If this option is set to "true", only the exact port will be used. By default, if a port is in use, the server will try to bind the next available higher port. This is true for the "port", "redirport" and "mpsport" settings. |
224
-| Lanonly | Server"s default mode if not set with "--cert" option. If this option is set to "true", Intel" AMT MPS will be disabled, server name and fixed IP option will be hidden. Mesh agents will search for the server using multicast on the network. |
225
-| Wanonly | A recommended option when running MeshCentral in the cloud. If set to "true", server will run as a cloud service and assumes LAN features are disabled. For this option to work, the server must have a fixed IP or DNS record using the "--cert"" option. In this mode, LAN discovery features are disabled. |
226
-| AllowFraming | By default is set to "false". If set to "true", web pages will be served in a way that allows them to be placed within an iframe of another web page. This is useful when you wish to add MeshCentral features into another website. |
227
-| AllowLoginToken | By default is set to "false". If set to "true", the server allows login tokens to be used in the URL as a replacement for user login. This is useful along with "allowFraming" option to embed MeshCentral features into another website. |
228
-| MongoDB | Used to specify the MongoDB connection string. If not specified, MeshCentral will use the NeDB database with the file meshcentral.db in the meshcentral-data folder. To setup MongoDB, please refer to the Database section of this document. |
229
-| MongoDBCol | Used to specify the MongoDB collection name in the database. By default this value is "meshcentral". See Database section for more details on MongoDB setup.
230
-| DbEncryptKey | Specifies a password used to encrypt the database when NeDB is in use. If wanting to encrypt an existing database, use the "dbexport" and "dbimport" to save and reload the database with the encryption password set. |
231
-| WebRTC | Set to "true" or "false" depending if you want to allow the server to setup WebRTC communication. If WebRTC is setup, management traffic will flow directly between the browser and mesh agent, bypassing the server completely. The default is false now, but will be switched to true when WebRTC is ready for production. |
232
-| ClickOnce | Set to "true" or "false" to allow or disallow browser ClickOnce features. When enabled, browsers running on Windows will be shown extra options to allow RDP and other sessions thru the MeshCentral server. This requires ClickOnce browser support that is built-in to IE and available as add-in to Chrome and Firefox. Default is true. |
233
-
234
-!!!important
235
- Changes in config.json will NOT take effect until server is restarted.
236
-
237
-**Note**: We recommend the user to use a non-production server to experiment the setting options above.
251
+As indicated before, the settings section of the config.json is equivalent to passing arguments to the server at runtime. In tha folowing table is a list of settings that are available for the user :
252
+
253
+| **Setting** | **Description** |
254
+|------------------|-----------------|
255
+| **Cert** | Sets the DNS name of the server. If this name is not set, the server will run in "LAN mode". When set, the server"s web certificate will use this name and the server will instruct agents and browsers to connect to that DNS name. You must set a server DNS name to run in "WAN mode". MeshCentral will not configure your DNS server. The DNS name must be configured separately. |
256
+| **Port** | This sets the main web port used by the MeshCentral server and it"s the same port that users and mesh agents will connect to. The default port is 443, but if the port is busy, the next available higher port is used (.e.g. 444) |
257
+| **AliasPort** | Sets the main port that will be used by the server externally. By default is the same as "Port" above, but can be set to be different when next. See "Server port aliasing" section for more details. |
258
+| **RedirPort** | This is the port for redirecting traffic in the web server. When the server is configured with HTTPS, users that uses HTTP will be redirected to HTTPS. Port 80 is the default port. So, redirection will happen from port 80 to port 443. |
259
+| **MpsPort** | Port for Intel" AMT Management Presence Server to receive Intel" AMT CIRA (Client Initiated Remote Access) connections. The default is port 4433. This port is disabled in LAN mode. If user don"t plan on using Intel" AMT for management, this port can be left as-is. |
260
+| **TLSOffload** | By default this option is set to "false". If set to "true", server will run both web port and the Intel AMT MPS port without TLS with the assumption that a TLS offloading is taking care of this task. For further details, see the "TLS Offloading" section. This option can also be set to the IP address of the reverse-proxy in order to indicate to MeshCental to only trust HTTP X-Forwarded headers coming from this IP address. See the "Reverse-Proxy Setup" section for an example.|
261
+| **SelfUpdate** | When set to "true" the server will check for a new version and attempt to self-update automatically a bit after midnight local time every day. If set to a specific version such as "1.1.21" the server will immediately update to the specified version on startup if it's not already at this version. |
262
+| **SessionKey** | This is the encryption key used to secure the user"s login session. It will encrypt the browser cookie. By default, this value is randomly generated each time the server starts. If many servers are used with a load balancer, all servers should use the same session key. In addition, one can set this key so that when the server restarts, users do not need to re-login to the server. |
263
+| **Minify** | Default value is 0, when set to 1 the server will serve "minified" web pages, that is, web pages that have all comments, white spaces and other unused characters removed. This reduces the data size of the web pages by about half and reduced the number requests made by the browser. The source code of the web page will not be easily readable, adding "&nominify=1" at the end of the URL will override this option. |
264
+| **User** | Specify a username that browsers will be automatically logged in as. Useful to skip the login page and password prompts. Used heavily during development of MeshCentral. |
265
+| **NoUsers** | By default this option is "false" and if set to "true", server will only accept users from localhost (127.0.0.1) and will not have a login page. Instead, a single user is always logged in. This mode is useful if user opts to setup MeshCentral as a local tool instead of as a multi-user server |
266
+| **MpsCert** | Specifies the official name of the Intel AMT MPS server. If not specified, this is the same as the official server name specified by "cert". This option is generally used with MPS aliasing, see the "Server port aliasing" section for more information. |
267
+| **MpsAliasPort** | Specify an alias port for the MPS server. See the section on "Server port aliasing" for use of this option. |
268
+| **ExactPorts** | If this option is set to "true", only the exact port will be used. By default, if a port is in use, the server will try to bind the next available higher port. This is true for the "port", "redirport" and "mpsport" settings. |
269
+| **Lanonly** | Server"s default mode if not set with "--cert" option. If this option is set to "true", Intel" AMT MPS will be disabled, server name and fixed IP option will be hidden. Mesh agents will search for the server using multicast on the network. |
270
+| **Wanonly** | A recommended option when running MeshCentral in the cloud. If set to "true", server will run as a cloud service and assumes LAN features are disabled. For this option to work, the server must have a fixed IP or DNS record using the "--cert"" option. In this mode, LAN discovery features are disabled. |
271
+| **AllowFraming** | By default is set to "false". If set to "true", web pages will be served in a way that allows them to be placed within an iframe of another web page. This is useful when you wish to add MeshCentral features into another website. |
272
+| **AllowLoginToken** | By default is set to "false". If set to "true", the server allows login tokens to be used in the URL as a replacement for user login. This is useful along with "allowFraming" option to embed MeshCentral features into another website. |
273
+| **MongoDB** | Used to specify the MongoDB connection string. If not specified, MeshCentral will use the NeDB database with the file meshcentral.db in the meshcentral-data folder. To setup MongoDB, please refer to the Database section of this document. |
274
+| **MongoDBCol** | Used to specify the MongoDB collection name in the database. By default this value is "meshcentral". See Database section for more details on MongoDB setup. |
275
+| **DbEncryptKey** | Specifies a password used to encrypt the database when NeDB is in use. If wanting to encrypt an existing database, use the "dbexport" and "dbimport" to save and reload the database with the encryption password set. |
276
+| **WebRTC** | Set to "true" or "false" depending if you want to allow the server to setup WebRTC communication. If WebRTC is setup, management traffic will flow directly between the browser and mesh agent, bypassing the server completely. The default is false now, but will be switched to true when WebRTC is ready for production. |
277
+| **ClickOnce** | Set to "true" or "false" to allow or disallow browser ClickOnce features. When enabled, browsers running on Windows will be shown extra options to allow RDP and other sessions thru the MeshCentral server. This requires ClickOnce browser support that is built-in to IE and available as add-in to Chrome and Firefox. Default is true. |
278
+
279
+!!! important
280
+ Changes in config.json will NOT take effect until server is restarted.
281
+
282
+---
283
+
284
+> **📌 Note :**
285
+
286
+> We recommend the user to use a non-production server to experiment the setting options above.
287
+
288
+---
289
290
### Domains
291
241
-In the domains section, you can set options for the default domain ("") in addition to creating new domains to establish a multi-tenancy server. For standard configuration, the root domain and other domains will be accessible like this:
292
+In the domains section, you can set options for the default domain ("") in addition to creating new domains to establish a multi-tenancy server. For standard configuration, the root domain and other domains will be accessible like this :
293
+
294
+
295
+ - 🔗 [https://servername:8080/](https://servername:8080/) — *Default domain*
296
243
-https://servername:8080/ <- default domain
297
+ - 🔗 [https://servername:8080/customer1](https://servername:8080/customer1) — *Customer1 domain*
298
245
-https://servername:8080/customer1 <- customer1 domain
299
+ - 🔗 [https://servername:8080/customer2](https://servername:8080/customer2) — *Customer2 domain*
300
247
-https://servername:8080/customer2 <- customer2 domain
301
249
-When a user setup many domains, the server considers each domain separately and each domain has separate user accounts, administrators, etc. If a domain has no users, the first created account will be administrator for that domain. Each domain has sub-settings as follows:
302
+When a user setup many domains, the server considers each domain separately and each domain has separate user accounts, administrators, etc. If a domain has no users, the first created account will be administrator for that domain.
303
251
-| Sub Settings | Description |
304
+Each domain has sub-settings as follows:
305
+
306
+| ***Sub Settings*** | ***Description*** |
307
| -------------- | -------- |
253
-| Title & Title2 | This are the strings that will be displayed at the banner of the website. By default title is set to “MeshCentral” and title2 is set to a version number |
254
-| UserQuota | This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a user account. |
255
-| MeshQuota | This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a given mesh |
256
-| NewAccounts | If set to zero (0) | only the administrator of this domain can create new user accounts. If set to one (1), anyone that can access the login page can create new user account |
257
-| UserAllowedIP | Allows user to set a list of allowed IP addresses. See section on server IP filtering. |
258
-| Auth | This mode is often used in corporate environments. When server is running on Windows and this value is set to “sspi”, domain control authentication to the website is performed. In this mode, no login screen is displayed and browser will authenticate using the user’s domain credentials. |
259
-| Dns | The DNS record for this domain. If specified, the domain is accessed using a DNS record like “customer1.servername.com” instead of “servername/customer1”. This feature requires the DNS server to be configured to point this server with a valid DNS record. |
260
-| CertUrl | Load the TLS certificate for this domain from this https url. For example “https://127.0.0.1:123”. This option is useful when used along with the “TlsOffload” option. When MeshCentral is not doing any TLS but has a reverse-proxy or TLS offload device doing this work in front of the server, you can use this to have MeshCentral load the certificate from the server in front of MeshCentral.<br><br>This is needed because when agents connect, they need to be told that the certificate they saw upon connecting is the correct one. Using this, MeshCentral will know what certificate the agents are expected to see. |
261
-| PasswordRequirements | Used to specify the minimum password requirements for user authentication to this domain. By default, no password requirements are enforced but the user will see a password strength indicator that is not backed by any verifiable data.<br><br>The value must be set to an object, for example:<br><br>`{ ""min"": 8, ""max"": 128, ""upper"": 1, ""lower"": 1, ""numeric"": 1, ""nonalpha"": 1 }`<br><br>This indicated that passwords must be at least 8 characters long and have at least one upper case, one lower case, one numeric and one non-alphanumeric character. You can also set the maximum length of the password, however MeshCentral has already a limit of 256 characters. Specifying anything above this will have no effect.<br><br>Note that password requirements for Intel® AMT are defined by Intel and so, Intel® AMT passwords will always be verified using a separate set of requirements. |
262
-
263
-**Note**: When the DNS value is set for a domain, user can’t access the domain using “servername/customer1” instead it must be accessed with the valid DNS record and the DNS server should be setup to have two or more DNS records pointing to the same IP address.
308
+| **Title & Title2** | This are the strings that will be displayed at the banner of the website. By default title is set to “MeshCentral” and title2 is set to a version number |
309
+| **UserQuota** | This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a user account. |
310
+| **MeshQuota** | This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a given mesh |
311
+| **NewAccounts** | If set to zero (0) | only the administrator of this domain can create new user accounts. If set to one (1), anyone that can access the login page can create new user account |
312
+| **UserAllowedIP** | Allows user to set a list of allowed IP addresses. See section on server IP filtering. |
313
+| **Auth** | This mode is often used in corporate environments. When server is running on Windows and this value is set to “sspi”, domain control authentication to the website is performed. In this mode, no login screen is displayed and browser will authenticate using the user’s domain credentials. |
314
+| **Dns** | The DNS record for this domain. If specified, the domain is accessed using a DNS record like “customer1.servername.com” instead of “servername/customer1”. This feature requires the DNS server to be configured to point this server with a valid DNS record. |
315
+| **CertUrl** | Load the TLS certificate for this domain from this https url. For example “https://127.0.0.1:123”. This option is useful when used along with the “TlsOffload” option. When MeshCentral is not doing any TLS but has a reverse-proxy or TLS offload device doing this work in front of the server, you can use this to have MeshCentral load the certificate from the server in front of MeshCentral.<br><br>This is needed because when agents connect, they need to be told that the certificate they saw upon connecting is the correct one. Using this, MeshCentral will know what certificate the agents are expected to see. |
316
+| **PasswordRequirements** | Used to specify the minimum password requirements for user authentication to this domain. By default, no password requirements are enforced but the user will see a password strength indicator that is not backed by any verifiable data.<br><br>The value must be set to an object, for example:<br><br>`{ ""min"": 8, ""max"": 128, ""upper"": 1, ""lower"": 1, ""numeric"": 1, ""nonalpha"": 1 }`<br><br>This indicated that passwords must be at least 8 characters long and have at least one upper case, one lower case, one numeric and one non-alphanumeric character. You can also set the maximum length of the password, however MeshCentral has already a limit of 256 characters. Specifying anything above this will have no effect.<br><br>Note that password requirements for Intel® AMT are defined by Intel and so, Intel® AMT passwords will always be verified using a separate set of requirements. |
317
+
318
+---
319
+
320
+> **📌 Note :**
321
+
322
+> When the DNS value is set for a domain, user can’t access the domain using “servername/customer1” instead it must be accessed with the valid DNS record and the DNS server should be setup to have two or more DNS records pointing to the same IP address.
323
+
324
+---
325
326
In this mode, the server will serve a different TLS certificate depending on what DNS record is used to access the server.
327
267
-
328
+
329
330
As shown in the example above, we have two names that point to the same IP address. Since the configuration specifies the “dns” value, the second domain is only shown when the right name is used. We use “meshcentral” and “devbox” for DNS names, but in practice the user will use fully qualified domain names (FQDN) like “meshcentral.com” or “devbox.meshcentral.com”.
331
271
-## Server Peering
332
+## 🤝 Server Peering
333
334
MeshCentral supports server peering. User could setup up many servers to share the task of handling incoming connections from managed clients and consoles. For server peering to function, all servers must have access to the same database, use the same certificates, the same configuration (with the exception of the server name) and servers must be able to communicate with each other behind a load balancer.
335
275
-
336
+
337
338
Hence, the user is expected to have good understanding on networking, server administration and applications to accomplish this setup. This document will not get into the details of setting up a load-balancer.
339
279
-!!!recommended
340
+!!! Recommended
341
Before setting up MeshCentral peering, database migration from NeDB database to MongoDB with replication/sharding option enabled is highly recommend. See: Setting up MeshCentral with MongoDB (section 8.4)
342
282
-
343
+
344
345
The setup flow above guides the user to pull together server peering setup with Meshcentral. (2) Shared storage is compulsory to host user files and it must be accessible from all of the servers. If the server is expected for critical work, replicated shared storage should be considered.
346
347
When Meshcentral is ready for peering setup (5), replicate the “meshcentral-data” directory on each server and configure the “peers” section of the config.json file as shown below.
348
288
-```
349
+```json
350
{
351
"peers": {
352
"serverId" : "Server1",
358
}
359
```
360
300
-The configuration above assumes that server1 has an IP address of ‘192.168.1.100’ and server2 has ‘192.168.1.101’ respectively. The "serverId" value is a short and unique identifier for each server and it is optional. If it's not specified, the computer hostname is used instead.
361
+The configuration above assumes that server1 has an IP address of `192.168.1.100` and server2 has `192.168.1.101` respectively. The "serverId" value is a short and unique identifier for each server and it is optional. If it's not specified, the computer hostname is used instead.
362
302
-The “servers” section of the configuration file should have the identifier of the server followed by each websocket URL and port (generally 443) of the peer servers. If the servers are running with “--tlsoffload”, then use “ws://” for the URL instead of “wss://”.
363
+The “servers” section of the configuration file should have the identifier of the server followed by each websocket URL and port (generally 443) of the peer servers. If the servers are running with `--tlsoffload`, then use “ws://” for the URL instead of `wss://`.
364
365
When the MongoDB is setup for the first time, a unique identifier is generated and written into the DB. To prevent situations where two servers with different database from peering together, during peering process, each server will validate among each other if they have the same unique DB identifier. Peering connection will only succeed if this condition is met.
366
367
Once peered, all of the servers should act like one single host, no matter which server the user(s) are connected to.
368
308
-## Email Setup
369
+## 📧 Email Setup
370
371
We highly recommend the use of an email server (SMTP) because we could allow MeshCentral to verify user account’s email address by sending a confirmation request to the user to complete the account registration and for password recovery, should a user forget account password as illustrated below
372
373
A verification email is sent when a new account is created or if the user requests it in the “My Account” tab.
374
314
-
375
+
376
377
The password recovery flow when “Reset Account” is triggered at the login page.
378
318
-
379
+
380
381
Both account verification and password recovery are triggered automatically once SMTP mail server configuration is included into the config.json file.
382
404
405
##### Gmail
406
346
-One option is to configure MeshCentral work with Google Gmail by setting “host” with smtp.gmail.com, and “port” with 587. In the config.json file, use user’s Gmail address for both “from” and “user” and Gmail password in the “pass” value. You will also need to enable “Less secure app access” in for this Google account. It’s in the account settings, security section:
407
+One option is to configure MeshCentral work with Google Gmail by setting `host` with smtp.gmail.com, and `port` with 587. In the config.json file, use user’s Gmail address for both `from` and “user” and Gmail password in the “pass” value. You will also need to enable “Less secure app access” in for this Google account. It’s in the account settings, security section:
408
348
-
409
+
410
411
If a Google account is setup with 2-factor authentication, the option to allow less secure applications not be available. Because the Google account password is in the MeshCentral config.json file and that strong authentication can’t be used, it’s preferable to use a dedicated Google account for MeshCentral email.
412
417
418
Start by visiting the Google API console:
419
359
-https://console.developers.google.com/
420
+> 🔗 [Google Developers Console](https://console.developers.google.com/)
421
422
First, you will create a new project. Name it something unique in case you need to create more in the future. In this example, I've named the project "MeshCentral"
423
363
-
424
+
425
426
Click on the "OAuth Consent Screen" link, Under "APIs and Services" from the left hand menu:
427
367
-
428
+
429
430
If you have a Google Workspace account, you will have the option to choose "Internal" application and skip the next steps. If not, you will be required to provide Google with information about why you want access, as well as verifying domain ownership.
431
371
-
432
+
433
434
Add the Gmail address under which you have created this project to the fields labelled ‘User support email’ and ‘Developer contact information’ so that you will be allowed for authentication. After that, you will want to add a scope for your app, so that your token is valid for gmail:
435
375
-
436
+
437
438
Once this is complete, the next step will be to add credentials.
439
379
-
440
+
441
442
Choose OAuth Client
443
449
450

451
391
-Enter your Client ID and secret from the last step. On the left side of the page, you should now see a text box that allows you to add your own scopes. Enter https://mail.google.com and click Authorize API.
452
+Enter your Client ID and secret from the last step. On the left side of the page, you should now see a text box that allows you to add your own scopes. Enter `https://mail.google.com` and click Authorize API.
453
454
You will need to follow the instructions provided to finish the authorization process. Once that is complete, you should receive a refresh token. The refresh token, Client ID and Client Secret are the final items we need to complete the SMTP section of our config.json. It should now look something like this:
455
395
-```
456
+```json
457
"smtp": {
458
"host": "smtp.gmail.com",
459
"port": 587,
473
474
Regardless of what SMTP account is used, MeshCentral will perform a test connection to make sure the server if working as expected when starting. Hence, the user will be notified if Meshcentral and SMTP server has been configured correctly as shown below.
475
415
-
476
+
477
478
After successfully configuring the Gmail SMTP server, switch the OAuth 'Publishing Status' from `Testing` to `In Production`. This step prevents the need for frequent refresh token generation. Verification of your project isn't required to make this change.
479
419
-
480
+
481
482
422
-## Database
483
+## 🛢️ Database
484
424
-A critical component of MeshCentral is the database. The database stores all of the user account information, groups and node data, historical power and event, etc. By default MeshCentral uses NeDB (https://github.com/louischatriot/nedb) that is written entirely in NodeJS and is setup automatically when MeshCentral is installed with the npm tool. The file “meshcentral.db” will be created in the “meshcentral-data” folder when MeshCentral is first launched. This database works well for small deployments scenarios.
485
+A critical component of MeshCentral is the database. The database stores all of the user account information, groups and node data, historical power and event, etc. By default MeshCentral uses [NeDB](https://github.com/louischatriot/nedb) that is written entirely in NodeJS and is setup automatically when MeshCentral is installed with the npm tool. The file `meshcentral.db` will be created in the “meshcentral-data” folder when MeshCentral is first launched. This database works well for small deployments scenarios.
486
487
Besides NeDB, MeshCentral fully supports MongoDB for larger deployments or deployments that require robust reliability or load-balancing. In this section we will see look at how to export and import the database file with a JSON file and how to configure MongoDB.
488
490
491
User could use a practical approach to migrate from NeDB to MongoDB, by exporting the entire content of the existing NeDB into JSON file, setup the new MongoDB and import that JSON file to create the schemas in MongoDB.
492
432
-To export the database, stop the MeshCentral server and run the server again with “--dbexport” and a JSON file called “meshcentral.db.json” will be created in the “meshcentral-data” folder as shown below.
493
+To export the database, stop the MeshCentral server and run the server again with `--dbexport` and a JSON file called `meshcentral.db.json` will be created in the `meshcentral-data` folder as shown below.
494
434
-
495
+
496
497
Alternatively, user can also specify the full export path for the JSON file as shown below.
498
438
-
499
+
500
501
### Database Import
502
503
Importing the MeshCentral database is useful when transitioning between database softwares (NeDB to/from MongoDB) or when importing the database from MeshCentral1 via migration tool.
504
444
-!!!important
505
+!!! important
506
Importing a JSON file will overwrite the entire content of the database. A starting empty database is recommended.
507
447
-When you are ready to import a JSON file into the database, run meshcentral with “--dbimport" as shown below. If path is not specified, the application will default to use “meshcentral.db.json” that is in “meshcentral-data” folder.
508
+When you are ready to import a JSON file into the database, run meshcentral with `--dbimport` as shown below. If path is not specified, the application will default to use `meshcentral.db.json` that is in `meshcentral-data` folder.
509
449
-
510
+
511
512
Alternatively, user can specify the full path of the import JSON as shown below.
513
453
-
514
+
515
516
### Viewing the Database
517
518
For debugging purposes, Meshcentral allow users to have quick preview of certain frequently accessed data in the database with the following options:
519
459
-| Option | Description |
520
+| ***Option*** | ***Description*** |
521
| ------------ | -------------------------------------- |
461
-| --showusers | List of all users in the database. |
462
-| --showmeshes | List of all meshes in the database. |
463
-| --shownodes | List of all nodes in the database |
464
-| --showevents | List all events in the database |
465
-| --showpower | List all power events in the database. |
466
-| --showall | List all records in the database. |
522
+| **`--showusers`** | List of all users in the database. |
523
+| **`--showmeshes`** | List of all meshes in the database. |
524
+| **`--shownodes`** | List of all nodes in the database |
525
+| **`--showevents`** | List all events in the database |
526
+| **`--showpower`** | List all power events in the database. |
527
+| **`--showall`** | List all records in the database. |
528
468
-For example, you can show the list of users with the “--showusers"
529
+For example, you can show the list of users with the `--showusers`
530
470
-
531
+
532
533
### MongoDB Setup
534
535
MongoDB is useful when setting up MeshCentral for two or more peer servers given that all peer servers much have access to the same database. NeDB and MongoDB have similar access interfaces hence the DB migration from one to the other is straight forward. Installing MongoDB depends on its host OS so do check for available download options at mongodb.com.
536
In this guide, we will focus on the 64-bit windows with SSL support installer.
537
477
-
538
+
539
540
After completing the installation step,
541
542
1. Stop any instance of Meshcentral that is running locally or in any machine
543
2. Start a terminal or Windows Command prompt (CMD),
544
3. Create a folder “c:\data\db”
484
-4. Go to the MongoDB bin folder and run “mongod --bind 127.0.0.1”.
545
+4. Go to the MongoDB bin folder and run `mongod --bind 127.0.0.1`.
546
+
547
+ This execute the database engine and store the database data in the default location “/data/db” path and bind a loopback on the local port “127.0.0.1”.
548
+ ---
549
486
- This execute the database engine and store the database data in the default location “/data/db” path and bind a loopback on the local port “127.0.0.1”.
550
+ > **📌 Note :**
551
488
- **Note**: Refer to MongoDB documentation to allow database to run in the background or experiment with alternate configurations.
552
+ > We recommend the user to use a non-production server to experiment the setting options above.
553
+ ---
554
490
- 
555
+ 
556
492
- **Note**: Upon successful execution, MongoDB will wait for connections on its default port 27017.
557
+ ---
558
+
559
+ > **📌 Note :**
560
+
561
+ > Upon successful execution, MongoDB will wait for connections on its default port 27017.
562
+
563
+ ---
564
565
5. Now run MeshCentral with the command below, it will tell Meshcentral to connect to MongoDB and use “meshcentral” DB. MongoDB will create this DB if it does not exist.
566
496
- ```
567
+ ```bash
568
node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral
569
```
570
500
- 
571
+ 
572
502
-6. Alternatively, to transition an existing meshcentral DB from NeDB and to MongoDB, just run the command below:
573
+6. Alternatively, to transition an existing meshcentral DB from NeDB and to MongoDB, just run commands below:
574
575
+ ```bash
576
+ node meshcentral --dbexport
577
```
505
- node meshcentral --dbexport
578
+
579
+ ```bash
580
node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral --dbimport
581
+ ```
582
+
583
+ ```bash
584
node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral
585
```
586
587
7. We recommend the user to include MongoDB configuration into the server’s configuration “config.json” to avoid specifying the “--mongodb" each time MeshCentral is executed as shown below
588
512
- ```
589
+ ```json
590
{
591
"settings": {
592
"mongodb": "mongodb://127.0.0.1:27017/meshcentral",
595
}
596
```
597
521
-**Note**: By default, MeshCentral will create a single collections called “meshcentral” in the specified database. If user want to specify a different collection name, use “--mongodbcol" or “mongodbcol” for settings like shown above.
598
+---
599
+
600
+> **📌 Note :**
601
+
602
+> By default, MeshCentral will create a single collections called “meshcentral” in the specified database. If user want to specify a different collection name, use “--mongodbcol" or “mongodbcol” for settings like shown above.
603
+
604
+---
605
606
If you are using MongoDB with authentication, you can change the URL a little to add the username and password, for example:
607
615
mongodb://username:password@127.0.0.1:27017/meshcentral?authMechanism=MONGODB-CR&authSource=db
616
```
617
535
-## Running State-less
618
+## 🌀 Running State-less
619
537
-By default, MeshCentral will read its configuration information from the “meshcentral-data” folder. The most important file in that folder being the “config.json” file, but the folder also contains certificates, branding images, terms of service and more.
620
+By default, MeshCentral will read its configuration information from the `meshcentral-data` folder. The most important file in that folder being the `config.json` file, but the folder also contains certificates, branding images, terms of service and more.
621
539
-
622
+
623
624
After the configuration is read, MeshCentral will connect to its database and continue to start the server. For most user’s this is a perfectly acceptable way to setup the server. However, in some cases, it’s advantageous to setup the server “state-less”. That is, there is no local configuration files at all and everything is in the database. Two examples of this would be when running MeshCentral is a Docker container where we don’t want the container to have any state or for compliance with security specifications where the database is “encrypted at rest”. In this cases, we will load the configuration files into the database and MeshCentral will only be told how to connect to the database.
625
543
-
626
+
627
628
When loading configuration information into the database, MeshCentral requires that a configuration file password be used to encrypt the configuration files in the database. This provides an additional layer of security on top of any authentication and security already provided by the database, if such security has been setup.
629
630
To make this happen, we will be using the following command line options from MeshCentral:
631
549
-| Command | Description |
632
+| ***Command*** | ***Description*** |
633
| ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
551
-| --configkey (key) | Specifies the encryption password that will be used to read or write the configuration files to the database. |
552
-| --dblistconfigfiles | List the names and size of all configuration files in the database. |
553
-| --dbshowconfigfile (filename) | Show the content of a specified filename from the database. --configkey is required. |
554
-| --dbdeleteconfigfiles | Delete all configuration files from the database. |
555
-| --dbpushconfigfiles '*' or (folder path) | Push a set of configuration files into the database, removing any existing files in the process. When * is specified, the “meshcentral-data” folder up pushed into the database. --configkey is required. |
556
-| --dbpullconfigfiles (folder path) | Get all of the configuration files from the database and place them in the specified folder. Files in the target folder may be overwritten. --configkey is required. |
557
-| --loadconfigfromdb (key) | Runs MeshCentral server using the configuration files found in the database. The configkey may be specified with this command or --configkey can be used. |
634
+| **`--configkey (key)`** | Specifies the encryption password that will be used to read or write the configuration files to the database. |
635
+| **`--dblistconfigfiles`** | List the names and size of all configuration files in the database. |
636
+| **`--dbshowconfigfile (filename)`** | Show the content of a specified filename from the database. --configkey is required. |
637
+| **`--dbdeleteconfigfiles`** | Delete all configuration files from the database. |
638
+| **`--dbpushconfigfiles '*' or (folder path)`** | Push a set of configuration files into the database, removing any existing files in the process. When * is specified, the “meshcentral-data” folder up pushed into the database. --configkey is required. |
639
+| **`--dbpullconfigfiles (folder path)`** | Get all of the configuration files from the database and place them in the specified folder. Files in the target folder may be overwritten. --configkey is required. |
640
+| **`--loadconfigfromdb (key)`** | Runs MeshCentral server using the configuration files found in the database. The configkey may be specified with this command or --configkey can be used. |
641
559
-Once we have MeshCentral running as expected using the “meshcentral-data” folder, we can simply push that configuration into the database and run using the database alone like this:
642
+Once we have MeshCentral running as expected using the `meshcentral-data` folder, we can simply push that configuration into the database and run using the database alone like this:
643
561
-```
644
+```bash
645
node ./node_modules/meshcentral --dbpushconfigfiles '*' --configkey mypassword
646
+```
647
648
+```bash
649
node ./node_modules/meshcentral --loadconfigfromdb mypassword --mongodb "mongodb://127.0.0.1:27017/meshcentral"
650
```
651
567
-This first line will load many of the “meshcentral-data” files into the database. At this point, we can back up the “meshcentral-data” folder and remove it. Then run the second line to start the server. Here we use MongoDB, but if one uses NeDB, the “meshcentral.db” file in the “meshcentral-data” folder will still be needed.
652
+This first line will load many of the “meshcentral-data” files into the database. At this point, we can back up the `meshcentral-data` folder and remove it. Then run the second line to start the server. Here we use MongoDB, but if one uses NeDB, the `meshcentral.db` file in the “meshcentral-data” folder will still be needed.
653
654
Note that MeshCentral does not currently support placing a Let’s Encrypt certificate in the database. Generally, one would use a reverse proxy with Let’s Encrypt support and TLS offload in the reverse proxy and then run MeshCentral in state-less mode in a Docket container.
655
571
-## Commandline Options
656
+## ⌨️ Commandline Options
657
658
In general, doing `--option value` is the same as adding `"option": value` in the settings section of the config.json.
659
660
Here are the most common options found by running `meshcentral --help`
661
577
-```
662
+```text
663
Run as a background service
664
--install/uninstall Install MeshCentral as a background service.
665
--start/stop/restart Control MeshCentral background service.
681
--adminaccount [userid] Promote account to site administrator.
682
```
683
599
-## TLS Offloading
684
+## 🔒 TLS Offloading
685
686
A good way for MeshCentral to handle a high traffic is to setup a TLS offload device at front of the server that takes care of doing all the TLS negotiation and encryption so that the server could offload this. There are many vendors who offer TLS or SSL offload as a software module (Nginx* or Apache*) so please contact your network administrator for the best solution that suits your setup.
687
688
As shown in the picture below, TLS traffic will come from the Internet and security will be handled by a device ahead of the server and MeshCentral only has to deal with TCP connections.
689
605
-
690
+
691
607
-To make this work, it is important the server is setup with “--tlsoffload”. This indicates the server that TLS is already being taken care of and MeshCentral does not have to deal with it. MeshCentral will continue to listen to port 80, 443 and 4433.
692
+To make this work, it is important the server is setup with `--tlsoffload`. This indicates the server that TLS is already being taken care of and MeshCentral does not have to deal with it. MeshCentral will continue to listen to port 80, 443 and 4433.
693
694
However, incoming port 443 (main web port) and 4433 (Intel® AMT MPS port) will not have TLS but MeshCentral will still put many HTTPS flags in its responses on port 443. By default, if a user accesses http://127.0.0.1:443 without TLS offloader setting, the browser is expected to display warnings. To make this work, TLS offloader device’s ports and functions should be configured correctly like below
695
611
-| Port | Function Description |
696
+| ***Port*** | ***Function Description*** |
697
| ---- | ---------------------------------------------------------------------- |
613
-| 80 | Directly forwards port 80 to MeshCentral port 80 |
614
-| 443 | Handle TLS using a web certificate and forward to MeshCentral port 443 |
615
-| 4433 | Handle TLS using MPS certificate and forward to MeshCentral port 4433 |
698
+| **80** | Directly forwards port 80 to MeshCentral port 80 |
699
+| **443** | Handle TLS using a web certificate and forward to MeshCentral port 443 |
700
+| **4433** | Handle TLS using MPS certificate and forward to MeshCentral port 4433 |
701
+
702
+If possible, port 443 should be configured with a legitimate trusted certificate and the public part of the certificate named as `webserver-cert-public.crt` must be placed inside of `meshcentral-data` folder of the server. When the server is executed in tlsoffload mode, only the public part of the web certificate is used by the server.
703
+
704
+For Intel® AMT MPS port 4433, the certificate files “mpsserver-cert-public.crt” and “mpsserver-cert-public.key” must be copied from the “meshcentral-data” folder and loaded into the TLS offload module.
705
617
-If possible, port 443 should be configured with a legitimate trusted certificate and the public part of the certificate named as “webserver-cert-public.crt” must be placed inside of “meshcentral-data” folder of the server. When the server is executed in tlsoffload mode, only the public part of the web certificate is used by the server.
706
+ ---
707
619
-For Intel® AMT MPS port 4433, the certificate files “mpsserver-cert-public.crt” and “mpsserver-cert-public.key” must be copied from the “meshcentral-data” folder and loaded into the TLS offload module.
708
+ > **📌 Note :**
709
621
-Note: Please consult the TLS offloader user manual from the respective vendor to configure TLS offloading feature correctly.
710
+ > Please consult the TLS offloader user manual from the respective vendor to configure TLS offloading feature correctly.
711
623
-## Let’s Encrypt support
712
+ ---
713
625
-MeshCentral makes use of HTTPS to authenticate and encrypt management traffic over the network. By default, a self-signed certificate is used for the MeshCentral HTTPS server. That certificate is not trusted by browsers and so, you get a warning message when visiting the web site. You can solve this but obtaining a free trusted certificate from Let’s Encrypt (https://letsencrypt.org/). There are some limitations and so, it’s best to get familiar with this service before starting. You will also need a valid domain name that you own and that points to your MeshCentral server.
714
+## 📜 Let’s Encrypt support
715
627
-
716
+MeshCentral makes use of HTTPS to authenticate and encrypt management traffic over the network. By default, a self-signed certificate is used for the MeshCentral HTTPS server. That certificate is not trusted by browsers and so, you get a warning message when visiting the web site. You can solve this but obtaining a free trusted certificate from [Let's Encrypt](https://letsencrypt.org/). There are some limitations and so, it’s best to get familiar with this service before starting. You will also need a valid domain name that you own and that points to your MeshCentral server.
717
629
-Before moving forward with this section, make sure your MeshCentral server is working correctly, has a domain name pointing to it and that the HTTP redirection server on port 80 is enabled and working. MeshCentral’s HTTP port 80 server will be used in the process to prove to Let’s Encrypt that we have control over the domain. At any point, you may try to use https://letsdebug.net/ to see if your domain is setup correctly and/or debug any issues. When ready, add the “letsencrypt” section to the config.json file like this:
718
+
719
+
720
+Before moving forward with this section, make sure your MeshCentral server is working correctly, has a domain name pointing to it and that the HTTP redirection server on port 80 is enabled and working. MeshCentral’s HTTP port 80 server will be used in the process to prove to Let’s Encrypt that we have control over the domain. At any point, you may try to use [letsdebug.net](https://letsdebug.net/) to see if your domain is setup correctly and/or debug any issues. When ready, add the “letsencrypt” section to the config.json file like this:
721
722
```json
723
{
735
736
The only mandatory field is the email address, please enter a valid one.
737
647
-The names section is a list of domain names the requested certificate will be valid for. This must be a list of DNS names that are already pointing to your server. It’s important to understand you are not requesting these DNS names, rather, Let’s Encrypt will makes requests to prove control over all of these domain name before issuing the certificate. All the domain names you enter must point to the server and HTTP port 80 must be reachable over the internet. If you don’t specify names, the default MeshCentral certificate name is used, that is the configured “--cert [name]”.
738
+The names section is a list of domain names the requested certificate will be valid for. This must be a list of DNS names that are already pointing to your server. It’s important to understand you are not requesting these DNS names, rather, Let’s Encrypt will makes requests to prove control over all of these domain name before issuing the certificate. All the domain names you enter must point to the server and HTTP port 80 must be reachable over the internet. If you don’t specify names, the default MeshCentral certificate name is used, that is the configured `--cert [name]`.
739
740
The RSA key size can only be 2048 or 3072, with the default being 3072. This is the number of bit used for the RSA key in the certificate. Bigger is more secure, but takes more time to compute.
741
743
744
The Let’s Encrypt certificates and files will be created in the “meshcentral-data” folder. Make sure to keep regular backups of the “meshcentral-data” folder and all sub-folders.
745
655
-
746
+
747
748
Once you placed the “letsencrypt” section in config.json, restart the server. The request to the Let’s Encrypt server may take a few minutes to a few hours. It’s best to have your DNS server name pointing to your server for over a day before doing this. Once the new certificate is received, the server will automatically restart and browsing to HTTPS on your server will show the new certificate. Here is what it looks like on FireFox:
749
659
-
750
+
751
752
If you successfully setup a Let’s Encrypt certificate using the Let’s Encrypt staging server (“production”: false) and everything looks good, stop the server, remove the “letsencrypt” folder in “meshcentral-data”, change production to “true” and start the server again. You should get a real certificate in a few minutes to a few hours. MeshCentral will automatically renew the certificate a few days before it expires. The MeshCentral self-signed certificate will still be present in the “meshcentral-data” folder, this is normal and there is no need to manually copy the Let’s Encrypt certificate to the “meshcentral-data” folder. If something goes wrong with the Let’s Encrypt certificate, the server will fall back to using the self-signed one.
753
663
-!!!note
754
+!!! note
755
Please be patient with Let’s Encrypt certificate requests and make sure you correctly get a staging certificate before setting production to true.
756
757
If Let’s Encrypt works for you, please consider donating to them as they provide a critical service to the Internet community.
758
668
-## Server IP filtering
759
+## 🛡️ Server IP filtering
760
761
For improved security, it’s good to limit access to MeshCentral with IP address. For example, we want to allow mesh agents and Intel AMT computers to connect from anywhere, but whitelist IP address for users that we allow to access MeshCentral.
762
672
-MeshCentral provides IP filtering option in the config.json file for each domain. For an example, we can set IP address whitelist for the default domain like as shown below.
763
+MeshCentral provides IP filtering option in the `config.json` file for each domain. For an example, we can set IP address whitelist for the default domain like as shown below.
764
674
-```
765
+```json
766
{
767
"domains": {
768
"": {
774
775
IP addresses are separated by a comma. As a result, only users coming these IP addresses will be able to see the server’s login page as illustrated below. Other IP addresses will be blocked effectively.
776
686
-
777
+
778
+
779
+ ---
780
+
781
+ > **📌 Note :**
782
688
-**Note**: When IP address whitelist is effective, Mesh Agent connection from any IP address will be not affected.
783
+ > When IP address whitelist is effective, Mesh Agent connection from any IP address will be not affected.
784
+
785
+ ---
786
787
You can also use files for IP lists
788
821
```
822
823
727
-## Embedding MeshCentral
824
+## 🧩 Embedding MeshCentral
825
826
One interesting way to use MeshCentral is to embed its features into another web site. In other words, certain feature of MeshCentral can be selectively embedded into another website such as Remote Desktop or File Transfer.
827
828
This allows another site to take care of the user accounts and business processes while MeshCentral takes care of remote management. In the example below, a user logs into an existing web site and received a page with MeshCentral remote desktop embedded into it.
829
733
-
830
+
831
+
832
+To make this work, a following key alignment is required :
833
+
834
+1. When a user requests the business website, the business web server must return the user a web page containing an iframe with a URL that points to the MeshCentral server.
835
+
836
+2. The URL must contain both a login token and embedding options. The login token tells MeshCentral under what MeshCentral account this request should be made.
837
735
-To make this work, a following key alignment is required:
736
-1. When a user requests the business website, the business web server must return the user a web page containing an iframe with a URL that points to the MeshCentral server.
737
-2. The URL must contain both a login token and embedding options. The login token tells MeshCentral under what MeshCentral account this request should be made.
838
3. The login token replaces the login screen of MeshCentral. Then, the embedding options can be used to specify no page title, header and footer to be displayed. This way, the page given by MeshCentral will fit nicely into the iframe.
839
840
In this section we will review both the login token and embedding options mentioned above.
841
842
### Login Token
843
744
-With MeshCentral, it’s possible to login to the main web page without even seeing the login screen. Of course, you can do this by specifying “--nousers" or “--user admin” when you run the server, but these approach are not secure as it removes user authentication for those accessing the server.
844
+With MeshCentral, it’s possible to login to the main web page without even seeing the login screen. Of course, you can do this by specifying `--nousers` or `--user admin` when you run the server, but these approach are not secure as it removes user authentication for those accessing the server.
845
846
With login tokens feature, a token can be generated to be used for a short time to login and skip the login page. This is perfect for embedding MeshCentral usages into other web site and probably for other applications.
847
748
-To enable this feature, configure config.json file to allow login tokens.
848
+To enable this feature, configure `config.json` file to allow login tokens.
849
850
```json
851
{
856
}
857
```
858
759
-Set both allowLoginToken and allowFraming to ‘true’ to use login tokens along with framing MeshCentral within another web page.
859
+Set both allowLoginToken and allowFraming to `true` to use login tokens along with framing MeshCentral within another web page.
860
761
-Next, create a token. Execute MeshCentral with the “--logintoken [userid]” switch and userid value with the example below:
861
+Next, create a token. Execute MeshCentral with the `--logintoken [userid]` switch and userid value with the example below:
862
763
-
863
+
864
765
-The “userid” is actually a combination of three values - user, domain, and username in a single string “user/domain/username”. The example above is using a default domain which is empty hence, the userid will be just “user//admin” to request for login token. Domains are only used if the server in multi-tenancy mode as discussed in previous chapters.
865
+The `userid` is actually a combination of three values - user, domain, and username in a single string `user/domain/username`. The example above is using a default domain which is empty hence, the userid will be just `user//admin” to request for login token. Domains are only used if the server in multi-tenancy mode as discussed in previous chapters.
866
867
The resulting hashed base64 encoded blob can be used as a login token for 1 hour. Simply add the “?login=” followed by the token value generated to the URL of the webserver. For an e.g. https://localhost/?login=23tY7@wNbPoPLDeXVMRmTKKrqVEJ3OkJ. The login page is expected to be skipped and automatically login the user admin. This is just a manual attempt to token based login.
868
769
-Now, to have this work seamlessly with a different website, we should generate a login token key. A token key can be used to generate login tokens whenever needed for MeshCentral. Generate this key with “--loginTokenKey" switch as shown below
869
+Now, to have this work seamlessly with a different website, we should generate a login token key. A token key can be used to generate login tokens whenever needed for MeshCentral. Generate this key with `--loginTokenKey` switch as shown below
870
771
-
871
+
872
873
The generated masker key must be placed in a secure location within the business website.
874
775
-
875
+
876
877
As illustrated above, we see the business site using the token key to generate a login token and embed it into the response web page. The user’s browser then loads the iframe that includes both the URL with the login token for MeshCentral. MeshCentral can then verify the token and allow the web page to load as expected.
878
886
| **hide** | "Indicates which portion of the web page to hide. <br>This is a bitmask integer hence it will need the sum of values. <br>For .e.g.: To hide all of the values, add 1+2+4+8 and use 15 as the value. | 1 = Hide the page header<br><br>2 = Hide the page tab<br><br>4 = Hide the page footer<br><br>8 = Hide the page title<br><br>16 = Hide the left tool bar<br><br>32 = Hide back buttons |
887
| **node** | Optional unless Viewmode is set to value of 10 or greater. <br>Indicates which node to show on the screen,<br><br>For example, if we want to embed the remote desktop <br>page for a given node and hide the header, tabs, <br>footer and page title, we could have this URL: <br>https://localhost/?node=UkSNlz7t...2Sve6Srl6FltDd&viewmode=11&hide=15" | Node or NodeID is a long base64 encoded SHA384 value |
888
789
-**Note**: Typically, the URL for the website is followed by “?” then a set of name=value pairs separated by “&”.
889
+ ---
890
+
891
+ > **📌 Note :**
892
+
893
+ > Typically, the URL for the website is followed by “?” then a set of name=value pairs separated by `&`.
894
+
895
+ ---
896
897
Based on the URL https://localhost/?node=UkSNlz7t...2Sve6Srl6FltDd&viewmode=11&hide=15 , the nodeID starts with “UkSNlz7t”. We shortened the value in this example, but it’s normally a long base64 encoded SHA384 value. The Viewmode set to 11 which is the remote desktop page and Hide set to 15 to hide everything. Hence the user may see as illustrated below.
898
793
-
899
+
900
795
-Only the remote desktop viewer will be displayed embedded within an iframe.
901
+Only the remote desktop viewer will be displayed embedded within an iframe.
902
797
-**Note**: User must set “allowFraming” to true in the config.json of the server. This is in addition to the Node, Viewmode and Hide arguments, the login token must be specified to add complex features into another website.
903
+ ---
904
799
-## Server port aliasing
905
+ > **📌 Note :**
906
+
907
+ > User must set “allowFraming” to true in the config.json of the server. This is in addition to the Node, Viewmode and Hide arguments, the login token must be specified to add complex features into another website.
908
+
909
+ ---
910
+
911
+## 🔀 Server port aliasing
912
913
In some cases, you may be setting up a server on a private network that uses non-standard ports, but use a router or firewall in front to perform port mapping. So, even if the server privately uses non-standard ports, the public ports are the standard ports 80 and 443. You have to tell MeshCentral to bind to private ports but pretend it’s using the other standard ports when communicating publicly. To make this work, MeshCentral supports port aliasing.
914
803
-For example you can run:
915
+For example you can run :
916
805
-```
917
+```bash
918
node meshcentral --redirport 2001 --port 2002 --aliasport 443
919
```
920
809
-
921
+
922
923
Here, the server binds the HTTP and HTTPS ports to 2001 and 2002, but the server will externally indicate to MeshAgents and browsers that they must connect to port 443.
924
925
In a different situation, you may want to setup a server so that both Mesh Agents and Intel AMT connect back to the server on port 443. This is useful because some corporation have firewalls that restrict outgoing connections to only port 80 and 443. By default, MeshCentral will be setup to have MeshAgents connection on port 443 and Intel AMT on port 4433.
926
815
-In the following picture we have a usual server running with:
927
+In the following picture we have a usual server running with :
928
817
-```
929
+```bash
930
node meshcentral --cert Server1 --port 443 --mpsport 4433
931
```
932
821
-
933
+
934
935
We can setup the server so that MeshAgent and Intel AMT will connect on port 443 of two different IP address or names like this:
936
825
-```
826
-node meshcentral --cert Server1 --mpscert Server2
827
---port 443 --mpsport 4433 --mpsaliasport 443
937
+```bash
938
+node meshcentral --cert Server1 --mpscert Server2 --port 443 --mpsport 4433 --mpsaliasport 443
939
```
940
830
-
941
+
942
832
-In the second example, the server on the right is running HTTPS on port 443 and MPS on port 4433 as usual, but the MPS is now presenting a certificate that has the name “Server2” on it. The server will also configure Intel AMT CIRA to connect to “Server2:443”.
943
+In the second example, the server on the right is running HTTPS on port 443 and MPS on port 4433 as usual, but the MPS is now presenting a certificate that has the name `Server2` on it. The server will also configure Intel AMT CIRA to connect to `Server2:443`.
944
834
-A router or firewall that is located in front of the MeshCentral server needs to be configured correctly to forwarding:
945
+A router or firewall that is located in front of the MeshCentral server needs to be configured correctly to forwarding :
946
836
-```
947
+```bash
948
Server1:443 -> 443 on MeshCentral
949
+```
950
+```bash
951
Server2:443 -> 4433 on MeshCentral
952
```
953
954
The routing of IP and ports by the firewall shown on the picture must be configured separately from MeshCentral using separate software. Typically, routers or firewalls have the proper controls to configure this type of traffic routes.
955
843
-## Web relay using DNS names and multiple web relays
956
+## 📡 Web relay using DNS names and multiple web relays
957
958
MeshCentral has a web relay feature that allows a user to access remote web sites thru the MeshCentral server without having to install MeshCentral Router. Web relay also allow you to use an alternate DNS name instead of a different web relay port which has a few advantages. You can also use multiple alternate DNS names which can be used at the same time to provide users with many HTTP/HTTPS relays.
846
-## Video Walkthrus
959
+
960
+## 🎬 Video Walkthrus
961
962
<div class="video-wrapper">
963
<iframe width="320" height="180" src="https://www.youtube.com/embed/GU7MQjkPSd8" frameborder="0" allowfullscreen></iframe>
964
+</div>
965
+<div class="video-wrapper">
966
<iframe width="320" height="180" src="https://www.youtube.com/embed/INOvsHXNOKY" frameborder="0" allowfullscreen></iframe>
967
</div>
968
853
-## Device Groups with Relay Agent
969
+## 🖧 Device Groups with Relay Agent
970
971
MeshCentral supports the local device group allowing devices that do not have an agent to be managed thru MeshCentral with regular SSH, SFTP, RDP, VNC protocols. Until now, the MeshCentral server had to be in LAN or Hybrid modes to support his device group and the managed devices had to be on the same network as the MeshCentral server. Starting with v1.0.11, users can create a local device group specifying a MeshAgent as a relay. This makes it possible to manage agent-less devices from anywhere on the Internet even if the server is in WAN mode. Simply install a single device with a MeshAgent on a network and create a local device group with that device as the relay.
972
857
-
973
+
974
859
-
975
+
976
861
-To enable SSH support, add this line to the domain section of your config.json:
977
+To enable SSH support, add this line to the domain section of your `config.json`:
978
979
```json
980
"ssh": true
981
```
982
867
-Video Walkthru
983
+### Video Walkthru
984
985
<div class="video-wrapper">
986
<iframe width="320" height="180" src="https://www.youtube.com/embed/TtW5-g6SeZQ" frameborder="0" allowfullscreen></iframe>
991
992
In addition to local device groups, the IP-KVM/Power switch device group was also improved to support a MeshAgent as a relay. This is big news for Raritan IP-KVM switch owners as you can now monitor your IP-KVM ports and access them remotely from the Internet. The same can be done with WebPowerSwitch allowing full out-of-band remote access to devices from anywhere in the world.
993
878
-
994
+
995
880
-
996
+
997
882
-
998
+
999
884
-## NGINX Reverse-Proxy Setup
1000
+## 🧭 NGINX Reverse-Proxy Setup
1001
1002
### Video Walkthru
1003
1004
<div class="video-wrapper">
889
- <iframe width="320" height="180" src="https://www.youtube.com/embed/YSmiLyKSX2I" frameborder="0" allowfullscreen></iframe>
1005
+ <iframe src="https://www.youtube.com/embed/YSmiLyKSX2I" frameborder="0" allowfullscreen></iframe>
1006
</div>
1007
892
-Sometimes it’s useful to setup MeshCentral with a reverse-proxy in front of it. This is useful if you need to host many services on a single public IP address, if you want to offload TLS and perform extra web caching. In this section we will setup NGINX, a popular reverse-proxy, in front of MeshCentral. NGNIX is available at: https://www.nginx.com/
1008
+Sometimes it’s useful to setup MeshCentral with a reverse-proxy in front of it. This is useful if you need to host many services on a single public IP address, if you want to offload TLS and perform extra web caching. In this section we will setup NGINX, a popular reverse-proxy, in front of MeshCentral. NGNIX is available at: [Nginx](https://www.nginx.com/)
1009
894
-
1010
+
1011
896
-In this example, we will:
1012
+In this example, we will :
1013
898
-- MeshCentral on non-standard ports, but alias HTTPS to port 443.
1014
+- Run MeshCentral on non-standard ports, but alias HTTPS to port 443.
1015
- NGINX will be using standard ports 80 and 443.
1016
- We will have NGINX perform all TLS authentication & encryption.
1017
- MeshCentral will read the NGINX web certificate so agents will perform correct server authentication.
1018
- NGINX will be setup with long timeouts, because agents have long standard web socket connections.
1019
904
-!!!note
1020
+!!! note
1021
With SELinux, NGINX reverse proxy requires 'setsebool -P httpd_can_network_relay 1'
1022
Caution: httpd_can_network_relay only allows certain ports
1023
Confirm you are using ports from this subset in MeshCentral
1024
If you want to use a different port then you will need to add it to http_port_t
1025
910
-Let’s get started by configuring MeshCentral with the following values in config.json:
1026
+Let’s get started by configuring MeshCentral with the following values in `config.json`:
1027
1028
```json
1029
{
1043
}
1044
```
1045
930
-With this configuration, MeshCentral will be using port 4430 instead of port 443, but because “TlsOffload” is set, TLS will not be performed on port 4430. The server name is set to “myservername.domain.com”, so that is the name that MeshCentral will give to agents to connect to. Also, the alias port is set to 443. So agents will be told to connect to “myservername.domain.com:443”.
1046
+With this configuration, MeshCentral will be using port 4430 instead of port 443, but because “TlsOffload” is set, TLS will not be performed on port 4430. The server name is set to `myservername.domain.com`, so that is the name that MeshCentral will give to agents to connect to. Also, the alias port is set to 443. So agents will be told to connect to “myservername.domain.com:443”.
1047
1048
The “AgentPong” line instructs the server to send data to the agent each 300 seconds and the agent by default will send data to the server every 120 seconds. As long as NGINX timeouts are longer than this, connections should remain open.
1049
1055
1056
Next, we need to configure and launch NGINX. Here is an ngnix.conf to get started:
1057
942
-```
1058
+```json
1059
worker_processes 1;
1060
1061
events {
1117
1118
Now we are ready to start NGINX and MeshCentral. You should start NGINX first because MeshCentral will try to fetch the certificate from NGINX upon start. When starting MeshCentral, you should see something like this:
1119
1004
-```
1120
+```bash
1121
MeshCentral HTTP redirection web server running on port 800.
1122
Loaded RSA web certificate at https://127.0.0.1:443/, SHA384: d9de9e27a229b5355708a3672fb23237cc994a680b3570d242a91e36b4ae5bc96539e59746e2b71eef3dbdabbf2ae138.
1123
MeshCentral Intel(R) AMT server running on myservername.domain.com:4433.
1130
1131
We can add on the section above and support reverse proxy for Intel® AMT Client Initiated more Access (CIRA) connecting that come to the server. Normally, CIRA connections come on port 4433 and use TLS.
1132
1017
-
1133
+
1134
1135
Since CIRA is a binary protocol, care must be taken to configure NGINX to handle the data as a TCP stream instead of HTTP. At the very bottom of the nginx.conf file, we can add the following:
1136
1021
-```
1137
+```json
1138
stream {
1139
# Internal MPS servers, in this case we use one MeshCentral MPS server is on our own computer.
1140
upstream mpsservers {
1182
With this configuration, Intel AMT CIRA connections will come in and TLS will be handled by NGINX. With this setup, it’s not possible to configure Intel AMT CIRA to connect using mutual-TLS authentication, only username/password authentication is used.
1183
1184
1069
-## Traefik Reverse-Proxy Setup
1185
+##🚦Traefik Reverse-Proxy Setup
1186
1187
In this section, we will setup MeshCentral with Traefik, a popular reverse proxy software. This section will be much like the previous section setting up NGNIX but with a different software and configuration file. Traefik is open source and available at: https://traefik.io/
1188
1189
This section covers a really simple Traefik configuration. Traefik is capable of a lot more complex configurations.
1190
1075
-
1191
+
1192
1193
In this example, we will:
1194
1217
}
1218
```
1219
1104
-**Note the “agentConfig” line**: Because Traefik does not support web socket connections that are not “masked”, we have to tell the Mesh Agents to mask web socket connections using this line. Once set, any new agent will be installed with the web socket masking turned on. Also note that we will be running MeshCentral on port HTTPS/4430 and HTTP/800. However, we also indicate to MeshCentral that HTTPS will really be on port 443 using the “AliasPort” line.
1220
+---
1221
+
1222
+> **📌 Note “agentConfig” line :**
1223
+
1224
+> Because Traefik does not support web socket connections that are not “masked”, we have to tell the Mesh Agents to mask web socket connections using this line. Once set, any new agent will be installed with the web socket masking turned on. Also note that we will be running MeshCentral on port HTTPS/4430 and HTTP/800. However, we also indicate to MeshCentral that HTTPS will really be on port 443 using the “AliasPort” line.
1225
1106
-The “TlsOffload” line indicates that MeshCentral should not perform TLS on port 4430. And the “certUrl” line indicates what URL can be used to load the external certificate that will be presented on port 443 in front of MeshCentral.
1226
+---
1227
+
1228
+The `TlsOffload` line indicates that MeshCentral should not perform TLS on port 4430. And the `certUrl` line indicates what URL can be used to load the external certificate that will be presented on port 443 in front of MeshCentral.
1229
1230
Now that we have MeshCentral setup, let’s take a look at a sample Traefik configuration file. In this case, we will manually configure the entrypoints, frontends and backends within the Traefik configuration file. There is a basic configuration file for Traefik 1.7:
1231
1276
1277
The backends section configures one MeshCentral server on port “4430”. Traefik will additionally check the health of the MeshCentral server periodically, every 30 seconds.
1278
1157
-The frontends section is what routes the connections coming in the entry points to the backend servers. In this case, the HTTPS entry point is routed to the MeshCentral server is the hostname matches “myserver.domain.com” or “localhost”.
1279
+The frontends section is what routes the connections coming in the entry points to the backend servers. In this case, the HTTPS entry point is routed to the MeshCentral server is the hostname matches `myserver.domain.com` or `localhost`.
1280
1281
Finally, the API section creates a web portal on port 8080 for monitoring of Traefik.
1282
1161
-## HAProxy Reverse-Proxy Setup
1283
+## ⚡ HAProxy Reverse-Proxy Setup
1284
1163
-In this section, we will setup MeshCentral with HAProxy, a small popular reverse proxy software. This section will be much like the previous sections setting up NGNIX and Traefik but with a different software and configuration file. HAProxy is free and available at: <https://www.haproxy.org/>
1285
+In this section, we will setup MeshCentral with HAProxy, a small popular reverse proxy software. This section will be much like the previous sections setting up NGNIX and Traefik but with a different software and configuration file. HAProxy is free and available at: [HAProxy Official Website](https://www.haproxy.org/)
1286
1165
-
1287
+
1288
1289
This section covers a really simple configuration. HAProxy is capable of a lot more complex configurations. In the following example, HAProxy will perform TLS and forward the un-encrypted traffic to MeshCentral on port 444. HAProxy will add extra “X-Forwarded-Host” headers to the HTTP headers so that MeshCentral will know from the IP address the connection comes from.
1290
1169
-
1291
+
1292
1293
In the following configuration file, we have browser connections on port 80 being redirected to HTTPS port 443. We also have Let’s Encrypt cert bot for getting a real TLS certificate and “mesh.sample.com” being redirected to 127.0.0.1:444.
1294
1173
-```
1295
+```yaml
1296
global
1297
log /dev/log local0
1298
log /dev/log local1 notice
1354
1355
We also specify “127.0.0.1” in TLS offload since we want MeshCentral to make use of the X-Forwarded-Host header that is set by HAProxy.
1356
1235
-## Running in a Production Environment
1357
+## 🏭 Running in a Production Environment
1358
1237
-When running MeshCentral is a production environment, administrators should set NodeJS to run in production mode. There is a good article here (http://www.hacksparrow.com/running-express-js-in-production-mode.html) on what this mode is and how to set it. This mode will also boost the speed of the web site on small devices like the Raspberry Pi. To run in production mode, the environment variable “NODE_ENV” must be set to “production”. On Linux, this is done like this:
1359
+When running MeshCentral is a production environment, administrators should set NodeJS to run in production mode. There is a good article here (http://www.hacksparrow.com/running-express-js-in-production-mode.html) on what this mode is and how to set it. This mode will also boost the speed of the web site on small devices like the Raspberry Pi. To run in production mode, the environment variable “NODE_ENV” must be set to “production”.
1360
1239
-```
1361
+- On Linux, this is done like this:
1362
+
1363
+```bash
1364
export NODE_ENV=production
1365
```
1366
1243
-On Windows, it’s done like this:
1367
+- On Windows, it’s done like this:
1368
1245
-```
1369
+```shell
1370
SET NODE_ENV=production
1371
```
1372
1249
-Special care must be taken to set the environment variable in such a way that if the server is rebooted, this value is still set. Once set, if you run MeshCentral manually, you will see:
1373
+Special care must be taken to set the environment variable in such a way that if the server is rebooted, this value is still set. Once set, if you run MeshCentral manually, you will see :
1374
1251
-```
1375
+```bash
1376
MeshCentral HTTP redirection web server running on port 80.
1377
MeshCentral v0.2.2-u, Hybrid (LAN + WAN) mode, Production mode.
1378
MeshCentral Intel(R) AMT server running on devbox.mesh.meshcentral.com:4433.
1381
1382
In production mode, ExpressJS will cache some files in memory making the web server much faster and any exceptions thrown by the ExpressJS will not result in the stack trace being sent to the browser.
1383
1260
-## Two step authentication
1384
+## 📲 Two step authentication
1385
1386
If the MeshCentral server is setup with a certificate name and not setup to use Windows domain authentication, then users will have the options to use 2-step authentication using the Google Authenticator application or any compatible application. Use of this option should be encouraged for users that manage a lot of critical computers. Once active the users will need to enter their username, password and a time limited token to login.
1387
1388
To get this features setup, users will need to go to the “My Account” tab or the “My Account” menu in the mobile application. They then select, “Add 2-stop login” and follow the instructions.
1389
1266
-
1390
+
1391
1392
Note that if a user performs a password recovery using email, the 2-step authentication is then turned off and will need to be turned on again. This is not idea as someone being able to intercept the user’s email could still log into the web site. Users should make sure to properly protect their email account.
1393
1405
1406
You can also setup [Duo 2FA](https://github.com/Ylianst/MeshCentral/blob/master/docs/docs/meshcentral/security.md#duo-2fa-setup) which is a commertial offering.
1407
1284
-## Server Backup & Restore
1408
+## 💾 Server Backup & Restore
1409
1410
It’s very important that the server be backed up regularly and that a backup be kept offsite. Luckily, performing a full backup of the MeshCentral server is generally easy to do. For all installations make sure to back up the following two folders and all sub-folders.
1411
1288
-```
1289
-meshcentral-data
1290
-meshcentral-files
1291
-```
1412
+ 1. `meshcentral-data`
1413
+ 2. `meshcentral-files`
1414
1415
If using NeDB that is built into MeshCentral, you are done. If you are running MongoDB, you will need to perform an extra step. In the command shell, run mongodump to archive all of the MongoDB databases.
1416
1295
-```
1417
+```bash
1418
mongodump --archive=backup.archive
1419
```
1420
1421
Then, keep the backup.archive file in a safe place. It’s critical that the content of meshcentral-data be backed up in a secure location and preferably using encryption, this is because it contains certificates that give this server its unique personality. Once agents are installed, they will only connect to this server and no other. If you reinstall MeshCentral, even if it is with the same domain name, agents will not connect to the new server since the server certificates are different. Also, someone with access to a backup of “meshcentral-data” could impersonate the server.
1422
1301
-To restore back backup, just install a MeshCentral server, make sure it works correctly. Stop it, wipe the old “meshcentral-data” and “meshcentral-files” and put the backup version instead. If using MongoDB, copy the backup.archive back, make sure to clean up any existing “meshcentral” database, run “mongo” and type:
1423
+To restore back backup, just install a MeshCentral server, make sure it works correctly. Stop it, wipe the old `meshcentral-data` and `meshcentral-files` and put the backup version instead. If using MongoDB, copy the backup.archive back, make sure to clean up any existing “meshcentral” database, run `mongo` and type:
1424
1303
-```
1425
+```bash
1426
use meshcentral
1427
+```
1428
+
1429
+```bash
1430
db.dropDatabase()
1431
```
1432
1433
Then exit with Ctrl-C and run:
1434
1310
-```
1435
+```bash
1436
mongorestore --archive=backup.archive
1437
```
1438
1439
This will re-import the database from the backup. You can then start MeshCentral again.
1440
1316
-!!!note
1441
+!!! note
1442
The two values for `backup` and `restore` in the json are only valid for databases backed by NeDB
1443
1444
### Backup to Google Drive
1445
1446
```bash
1447
sudo systemctl stop meshcentral.service
1448
+```
1449
+
1450
+```bash
1451
nano /opt/meshcentral/meshcentral-data/config.json
1452
```
1453
1454
Remove underscored items
1455
1328
-
1456
+
1457
1458
```bash
1459
sudo systemctl start meshcentral.service
1460
+```
1461
+
1462
+```bash
1463
sudo systemctl status meshcentral.service
1464
```
1465
1466
Log into your MC:
1467
1337
-
1468
+
1469
1339
-
1470
+
1471
1472
Create desktop app
1473
1343
-
1474
+
1475
1476
Enter the Client ID and Client Secret into MC
1477
1347
-
1478
+
1479
1349
-
1480
+
1481
1351
-## HashiCorp Vault support
1482
+## 🗝️ HashiCorp Vault support
1483
1353
-MeshCentral has built-in support for HashiCorp Vault so that all configuration and certificates used by MeshCentral are retrieved from a Vault server. Vault is a secret store server and when used with MeshCentral, the MeshCentral server will not be storing any secrets locally. You can get started with Vault here: https://www.vaultproject.io/
1484
+MeshCentral has built-in support for HashiCorp Vault so that all configuration and certificates used by MeshCentral are retrieved from a Vault server. Vault is a secret store server and when used with MeshCentral, the MeshCentral server will not be storing any secrets locally. You can get started with Vault here: [HashiCorp Vault Official Site](https://www.vaultproject.io/)
1485
1486
Once you got a MeshCentral server working correctly, you can start a simple demonstration Vault server by typing:
1487
1357
-```
1488
+```bash
1489
vault server -dev
1490
```
1491
1497
1498
Once all of the files have been written into Vault, you can take a look at the Vault web user interface to see all of the secrets. It will be in “secret/meshcentral”:
1499
1369
-
1500
+
1501
1371
-The “config.json” and “terms.txt” files and files in “meshcentral-data” that end with “.key”, “.crt”, “.jpg” and “.png” will be stored in Vault. You can then run MeshCentral like this:
1502
+The `config.json` and `terms.txt` files and files in `meshcentral-data` that end with `.key`, `.crt`, `.jpg` and `.png` will be stored in Vault. You can then run MeshCentral like this:
1503
1373
-```
1504
+```bash
1505
node node_modules/meshcentral --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
1506
```
1507
1377
-MeshCentral will first read all of the files from Vault and get started. An alternative to this is to create a very small config.json file in “meshcentral-data” that contains only the Vault configuration like this:
1508
+MeshCentral will first read all of the files from Vault and get started. An alternative to this is to create a very small `config.json` file in “meshcentral-data” that contains only the Vault configuration like this:
1509
1510
```json
1511
{
1522
1523
Once the config.json file is setup, you can just run MeshCentral without any arguments.
1524
1394
-```
1525
+```bash
1526
node node_modules/meshcentral
1527
```
1528
1529
Lastly you can all pull all of the files out of Vault using this command line:
1530
1400
-```
1531
+```bash
1532
node node_modules/meshcentral --vaultpullconfigfiles --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
1533
```
1534
1535
And delete the Vault secrets using this:
1536
1406
-```
1537
+```bash
1538
node node_modules/meshcentral --vaultdeleteconfigfiles --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
1539
```
1540
1410
-## Database Record Encryption
1541
+## 🔏 Database Record Encryption
1542
1543
Regardless if using the default NeDB database or MongoDB, MeshCentral can optionally encrypt sensitive data that is stored in the database. When enabled, this encryption is applied to user credentials and Intel AMT credentials.
1544
1414
-
1545
+
1546
1416
-The additional encryption does the affect database operations and can be used in addition to additional database security. In the following image, we see on the left a normal user record including user credential hashes and data required for two-factor authentication. On the right side, these values are encrypted using AES-256-GCM in the “_CRYPT” field.
1547
+The additional encryption does the affect database operations and can be used in addition to additional database security. In the following image, we see on the left a normal user record including user credential hashes and data required for two-factor authentication. On the right side, these values are encrypted using AES-256-GCM in the `_CRYPT` field.
1548
1418
-
1549
+
1550
1551
Only some data fields are encrypted and the “_CRYPT” entry will only be present when one or more fields are present that need to be secured. To enable this feature, add the “DbRecordsEncryptKey” with a password string to the “settings” section of the config.json like this:
1552
1562
1563
The provided password will be hashed using SHA384 and the result with be used as an encryption key. When DbRecordsEncryptKey is set, any new or updated records that are written will be encrypted when needed. Existing encrypted records will be read and decrypted as needed. You can force the all entries to be re-written by running:
1564
1434
-```
1565
+```bash
1566
node node_modules/meshcentral --recordencryptionrecode
1567
```
1568
1580
1581
When set, the key will only be used for decryption and any new or updated records in the database will not be written with record encryption. You can then run this command again to force all records to be rewritten without encryption:
1582
1452
-```
1583
+```bash
1584
node node_modules/meshcentral --recordencryptionrecode
1585
```
1586
1587
It’s really important to keep the encryption key in a safe place along with database backups. If the database is backed up but the record encryption key is lost, it will not be possible to recover the secured data in the database.
1588
1458
-Also note that database record encryption can and should be used along with other data protection systems.
1589
+ ---
1590
+
1591
+ > **📌 Note :**
1592
+
1593
+ > Also note that database record encryption can and should be used along with other data protection systems.
1594
+
1595
+ ---
1596
1460
-## MongoDB free server monitoring
1597
+## 📊 MongoDB free server monitoring
1598
1599
If running with MongoDB version 4.x, there is a free database monitoring service that is provided. Just run “mongo” and you may see the following:
1600
1464
-
1601
+
1602
1466
-Type “db.enableFreemonitoring()” if you want to enable this. You will be given a URL to access the data and can turn it back off at any time. The web page will look something like this:
1603
+Type `db.enableFreemonitoring()` if you want to enable this. You will be given a URL to access the data and can turn it back off at any time. The web page will look something like this:
1604
1468
-
1605
+
1606
1607
In addition to database specific information, the graphs track CPU, memory and disk usage. This can be useful to track how well the server is responding under load.
1608
1472
-## MeshCentral Single Sign-On (SSO)
1609
+## 🔓 MeshCentral Single Sign-On (SSO)
1610
1611
As with any web application deployed in organization, it’s convenient and more secure for users to have a single set of credentials that can be used across many services. In this section we take a look at how to configure MeshCentral so that you can sign-in using credentials from other services. This allows users to completely skip creating a user account on MeshCentral or having to remember usernames and password for one more web site. There are two single sign-on protocols that are supported in MeshCentral, OAuth2 and SAML. We will take a look at an example for each one.
1612
1625
1626
### Twitter Authentication
1627
1491
-Like many other services, Twitter allows its users to login to other web site using Twitter credentials using OAuth2. Start by creating an account on Twitter and logging in. Then navigate to <https://developer.twitter.com/en/apps>, this is where you can create new applications that are compatible with Twitter.
1628
+Like many other services, Twitter allows its users to login to other web site using Twitter credentials using OAuth2. Start by creating an account on Twitter and logging in. Then navigate to [Twitter Developer Apps](https://developer.twitter.com/en/apps), this is where you can create new applications that are compatible with Twitter.
1629
1630
Start by creating a new application and fill in the application form. Give your application and name, description, server URL and more.
1631
1495
-
1632
+
1633
1497
-Make sure to select “Enable Sign in with Twitter” and set the callback URL to “https://(server.domain.com)/auth-twitter-callback”. This is the URL that Twitter will redirect users to once they are logged in. For example this is what a sample application would look like:
1634
+Make sure to select “Enable Sign in with Twitter” and set the callback URL to `https://(server.domain.com)/auth-twitter-callback`. This is the URL that Twitter will redirect users to once they are logged in. For example this is what a sample application would look like:
1635
1499
-
1636
+
1637
1501
-Once the new application is created, go to the “Keys and tokens” tab. You will need the “API Key” and “API secret key” values. In the MeshCentral config.json, place these two values as “clientid” and “clientsecret” of the Twitter section of the “AuthStrategies”.
1638
+Once the new application is created, go to the `Keys and tokens` tab. You will need the `API Key` and `API secret key` values. In the MeshCentral `config.json`, place these two values as `clientid` and `clientsecret` of the Twitter section of the `AuthStrategies`.
1639
1503
-
1640
+
1641
1642
Once done, your config.json should look a bit like this:
1643
1664
}
1665
```
1666
1530
-Note that if you do not allow new accounts, any new users that use Twitter credentials will not be able to login to MeshCentral. One trick is to allow new account, login and change this setting again. Once the config.json is correct, restart the server and you should see the Twitter icon on the login screen. When restarting the MeshCentral server, new modules will need to be installed to support this new feature. Depending on how your server is setup, you may need to restart the server manually to allow the new modules to be installed.
1667
+ ---
1668
1532
-
1669
+ > **📌 Note :**
1670
+
1671
+ > Note that if you do not allow new accounts, any new users that use Twitter credentials will not be able to login to MeshCentral. One trick is to allow new account, login and change this setting again. Once the config.json is correct, restart the server and you should see the Twitter icon on the login screen. When restarting the MeshCentral server, new modules will need to be installed to support this new feature. Depending on how your server is setup, you may need to restart the server manually to allow the new modules to be installed.
1672
+
1673
+ ---
1674
+
1675
+
1676
1677
### Google, GitHub, Reddit Authentication
1678
1536
-The exact same process as shown in the previous section can be repeated for Google, GitHub and Reddit. In each case, you need to go to each respective credential provider and get a “ClientID” and “ClientSecret” for each service. You also need to register the correct callback URL for each service. Take a look at the config.json below and note the callback URL that will need to be registered for each service provider.
1679
+The exact same process as shown in the previous section can be repeated for Google, GitHub and Reddit. In each case, you need to go to each respective credential provider and get a `ClientID` and `ClientSecret` for each service. You also need to register the correct callback URL for each service.
1680
+
1681
+Take a look at the `config.json` below and note the callback URL that will need to be registered for each service provider.
1682
1683
```json
1684
{
1725
1726
In this section we look at how to setup MeshCentral to Azure Active Directory using OAuth. Like all other sections about setting up single sign-on, make sure your MeshCentral server is already setup on the public Internet with a valid TLS certificate. You can then start by adding a new application registration to the Azure portal.
1727
1583
-
1728
+
1729
1585
-
1730
+
1731
1587
-We give our application a name, generally the domain name of the MeshCentral server is a good choice. Then you can setup the redirect URL to https://[servername]/auth-azure-callback. Make sure to type this correctly, all lower case with the full domain name of your MeshCentral server. Once done, there are two values we will need later, the Application ID and Tenant ID.
1732
+We give our application a name, generally the domain name of the MeshCentral server is a good choice. Then you can setup the redirect URL to `https://[servername]/auth-azure-callback`. Make sure to type this correctly, all lower case with the full domain name of your MeshCentral server. Once done, there are two values we will need later, the Application ID and Tenant ID.
1733
1589
-
1734
+
1735
1591
-Next, we need to create a secret that will be shared between Azure and MeshCentral. Go to the “Certificates & secrets” section and click “New client secret”. You then enter a name and for our example, we will opt to never make it expire.
1736
+Next, we need to create a secret that will be shared between Azure and MeshCentral. Go to the `Certificates & secrets` section and click `New client secret`. You then enter a name and for our example, we will opt to never make it expire.
1737
1593
-
1738
+
1739
1595
-
1740
+
1741
1742
We then copy the resulting secret and this will be the 3rd and final value we need to get MeshCentral setup. Now, we take the application ID, tenant ID and secret and place these values in the MeshCentral config.json like so:
1743
1766
}
1767
```
1768
1624
-The “Application ID” value is placed as “Client ID” in the configuration file. You can also see that in the example above, we have “NewAccounts” set to false in the default MeshCentral domain, but set to true in the Azure section. This indicates that new accounts are not allowed in this domain except if it’s a new user that is authenticating thru Azure. Once done, restart the MeshCentral server. Depending on your setup, you many need to run MeshCentral once manually to allow new required modules to be installed. Once running again, you should see the Azure single sign-on button on the login page.
1769
+The `Application ID` value is placed as `Client ID` in the configuration file. You can also see that in the example above, we have `NewAccounts` set to false in the default MeshCentral domain, but set to true in the Azure section. This indicates that new accounts are not allowed in this domain except if it’s a new user that is authenticating thru Azure. Once done, restart the MeshCentral server. Depending on your setup, you many need to run MeshCentral once manually to allow new required modules to be installed. Once running again, you should see the Azure single sign-on button on the login page.
1770
1626
-
1771
+
1772
1773
### JumpCloud Authentication using SAML
1774
1776
1777
In this section, we setup MeshCentral with JumpCloud, an easy to use sign-in provider. You can create an account on JumpCloud for free with up to 10 users allowing you to quickly get setup and test the following setup. In the next section, we look at a generic SAML configuration.
1778
1634
-Before getting started with this section, make sure your server is on the Internet and publicly available and that it has a valid TLS certificate. You can use Let’s Encrypt to get a valid TLS certificate. Then, start by going to <https://jumpcloud.com> and creating an administrator account. Once setup, go to “Applications” and click on the big plug sign to create a new application.
1779
+Before getting started with this section, make sure your server is on the Internet and publicly available and that it has a valid TLS certificate. You can use Let’s Encrypt to get a valid TLS certificate. Then, start by going to [JumpCloud](https://jumpcloud.com) and creating an administrator account. Once setup, go to `Applications` and click on the big plug sign to create a new application.
1780
1636
-
1781
+
1782
1638
-You will need to create a custom SAML application by clicking the “Custom SAML App”.
1783
+You will need to create a custom SAML application by clicking the `Custom SAML App`.
1784
1640
-
1785
+
1786
1787
Then, you can fill in the form with an application name and logo.
1788
1644
-- For the IdP Entity ID, put “jumpcloud”.
1645
-- For the SP Entity ID put “meshcentral”.
1646
-- For the ACS URL, put the callback URL of your server. In this case it will be “https://(yourservername)/auth-jumpcloud-callback”
1789
+- For the IdP Entity ID, put `jumpcloud`.
1790
+- For the SP Entity ID put `meshcentral`.
1791
+- For the ACS URL, put the callback URL of your server. In this case it will be `https://(yourservername)/auth-jumpcloud-callback`
1792
- Lastly in the attributes section, add 3 user attribute mapping.
1648
- - “firstname” to “firstname”
1649
- - “lastname” to “lastname”
1650
- - “email” to “email”
1793
+ - `firstname` to `firstname`
1794
+ - `lastname` to `lastname`
1795
+ - `email` to `email`
1796
1797
The attribute mappings will allow MeshCentral to receive from JumpCloud the first and last name of the user and the email address of the use. If any of these values are changed in the future, MeshCentral will update them the next time the user logs into MeshCentral. Here is an example configuration with red arrows next to important values.
1798
1654
-
1799
+
1800
1656
-Once setup, you will need to allow one or more users to use the new application. One way to do this is to just add your new application to the “All Users” group.
1801
+Once setup, you will need to allow one or more users to use the new application. One way to do this is to just add your new application to the `All Users` group.
1802
1658
-
1803
+
1804
1660
-We are now almost done with JumpCloud. The last thing we need to do is download the certificate that JumpCloud will be using to sign the SAML assertions. You can get this certificate by going in the “Applications” tab, click on your new application and select “Download Certificate” as shown here.
1805
+We are now almost done with JumpCloud. The last thing we need to do is download the certificate that JumpCloud will be using to sign the SAML assertions. You can get this certificate by going in the `Applications` tab, click on your new application and select `Download Certificate` as shown here.
1806
1807

1808
1664
-Save the certificate as “jumpcloud-saml.pem” and place it in the “meshcentral-data” folder. You are now ready to configure MeshCentral. Edit the config.json and make it look like this:
1809
+Save the certificate as `jumpcloud-saml.pem` and place it in the `meshcentral-data` folder. You are now ready to configure MeshCentral.
1810
+
1811
+Edit the `config.json` and make it look like this:
1812
1813
```json
1814
{
1836
}
1837
```
1838
1692
-Take note that the “entityid”, “idpurl” and “cert” are values taken from JumpCloud. The callback URL should be configured in JumpCloud as we have done in previous steps. You can see that in the example above, we have “NewAccounts” set to false in the default MeshCentral domain, but set to true in the JumpCloud section. This indicates that new accounts are not allowed in this domain except if it’s a new user that is authenticating thru JumpCloud.
1839
+Take note that the `entityid`, `idpurl` and `cert` are values taken from JumpCloud. The callback URL should be configured in JumpCloud as we have done in previous steps. You can see that in the example above, we have `NewAccounts` set to false in the default MeshCentral domain, but set to true in the JumpCloud section. This indicates that new accounts are not allowed in this domain except if it’s a new user that is authenticating thru JumpCloud.
1840
1841
You are now ready to restart the MeshCentral server. Extra modules will be needed to support SAML and so, depending on your server configuration, you may need to run MeshCentral manually once to allow the new modules to be installed from NPM. Once restarted, you should see the JumpCloud sign-in button on the login screen.
1842
1696
-
1843
+
1844
1845
Users can sign-in using the regular username and password or using JumpCloud.
1846
1847
### Generic SAML setup
1848
1702
-In this section, we look at configuring SAML with a generic authentication provider. The setup is exactly the same as with JumpCloud in the previous section, but we will be using a different section in the config.json to that a generic login icon is shown on the login page.
1849
+In this section, we look at configuring SAML with a generic authentication provider. The setup is exactly the same as with JumpCloud in the previous section, but we will be using a different section in the `config.json` to that a generic login icon is shown on the login page.
1850
1851
A generic SAML setup will look like this:
1852
1875
}
1876
```
1877
1731
-The callback URL will be of the form “https://(servername)/auth-saml-callback”. You should set the entityid, idpurl as given by the identity provider. Lastly, place the identity provider certificate file in the “meshcentral-data” folder and indicate the name of the file in “cert”. Once setup, restart the server and you should see a Single Sign-on button on the login screen.
1878
+The callback URL will be of the form `https://(servername)/auth-saml-callback`. You should set the entityid, idpurl as given by the identity provider. Lastly, place the identity provider certificate file in the `meshcentral-data` folder and indicate the name of the file in `cert`.
1879
1733
-
1880
+Once setup, restart the server and you should see a Single Sign-on button on the login screen.
1881
+
1882
+
1883
1884
Enabling SAML will require MeshCentral to install extra modules from NPM, so depending on your server configuration, you may need to run MeshCentral once manually.
1885
1737
-!!!note
1738
- MeshCentral only supports "POST". [For example Authentik's](https://github.com/Ylianst/MeshCentral/issues/4725) default setting is to use "Redirect" as a "Service Provider Binding".
1886
+!!! note
1887
+ MeshCentral only supports "POST". [For example Authentik's](https://github.com/Ylianst/MeshCentral/issues/4725) default setting is to use `Redirect` as a `Service Provider Binding`.
1888
1889
### Generic OpenID Connect Setup
1890
1916
1917
As you can see, this is roughly the same as all the other OAuth2 based authentication strategies. These are the basics you need to get started using OpenID Connect because it's still authenticating with OAuth2. If you plan to take advantage of some of the more advanced features provided by this strategy you should consider reading the [additional strategy documentation](./openidConnectStrategy.md).
1918
1770
-> NOTE: MeshCentral will use `https://mesh.your.domain/auth-oidc-callback` as the default redirect uri.
1771
-
1772
-## Improvements to MeshCentral
1773
-
1774
-In 2007, the first version of MeshCentral was built. We will refer to it as “MeshCentral1”. When MeshCentral1 was designed, HTML5 did not exist and web sockets where not implemented in any of the major browsers. Many design decisions were made at the time that are no longer optimal today. With the advent of the latest MeshCentral, MeshCentral1 is no longer supported and MeshCentral v2 has been significantly redesigned and mostly re-written based of previous version. Here is a list of improvements made in MeshCentral when compared with MeshCentral1:
1775
-
1776
-- Quick Installation – By having MeshCentral published on NPM (www.npmjs.com) it’s now easy to download and install MeshCentral on both Linux and Windows*. On Linux* you can use NPM directly (“npm install meshcentral”) and on Windows you can use the .MSI installer.
1777
-- Cross-Platform Support – Contrary to MeshCentral1 that only runs on Windows*, MeshCentral can run on any environment that supports NodeJS. This includes Windows*, Linux* and OSX*. Because MeshCentral runs on Linux, it often lowers hosting costs and makes it possible to run MeshCentral in a Docker* container environment.
1778
-- Runs with Little Compute Resources – Typical MeshCentral1 installation requires a large disk space foot print (approx* 30G of disk space) and is compute intensive even for small deployments. MeshCentral requires little resources to host (70MB) and able to deliver reasonable performance on a 900Mhz CPU with 1GB RAM.
1779
-- Multi-Tenancy and Load Balancing Support – MeshCentral can handle hosting many server instances at once. Each instance or “domain” has it’s own administrators, users and computers to manage. The server can handle each instance using a url path “server.com/customer1” or a DNS name “customer1.server.com”. Many customers can be handled by having all the DNS names point to the same server IP address. MeshCentral will take care of serving the right TLS certificate for each connection.
1780
-- Single Executable – MeshCentral is a single-module or single executable server. All of the components of MeshCentral1 including IIS, Swarm, AJAX, Social, Manageability Servers are all build into one single executable. This makes it super easy to setup and run, it also minimizes problems and overhead caused by having many components communicate to each other. When the server is updated, all of the components are updated at once and effective.
1781
-- Web Application Design – MeshCentral1 has 100’s of web pages and often times a click on a web page causes the browser to load a different web page and this creates more load on the server. With MeshCentral there are only two main web pages: The login page and the main web application. This design is much more responsive since the server now delegates most of the UI workload to the client’s web browser.
1782
-- Real-Time User Interface – In MeshCentral, the user never has to hit the “refresh” button to update the web page. The web interface is completely real-time and updates as things change. MeshCentral uses websockets to connect to the server and get real-time events.
1783
-- Single Programming Language – MeshCentral1 used JavaScript on the browser, C# on the server and C for the agent. Use of 3 different programming languages means that developers wanting to implement a new use-case needs to have sufficient skills to change between these 3 languages during the coding session. Makes the code significantly more difficult to understand and maintain.
1784
-- Support for LAN only Mode – MeshCentral is capable of being setup as “LAN only” mode. In fact, this is the default mode when no static name or IP address is provided. In this mode, MeshAgents perform a multicast search on the network for the server making a static DNS/IP unnecessary.
1785
-- Support for TLS Offloaders – TLS offloaders are now fully supported. This means that MeshCentral can handle way more network connections and traffic significantly.
1786
-- Support for CIRA User/Pass Login – MeshCentral now supports both Intel AMT CIRA user/pass login and certificate login. Compared to MeshCentral1 that only supported certificate login, user/pass login is easier to setup and it can also be used for TLS offloaders and CIRA authentication.
1787
-- No Live State Stored in the Database – One if the big problems with MeshCentral1 is that a lot of the live states (Agent, User and AMT connections and disconnections) needed to be stored in the database. This caused a few problems, first the extra load on the database that was un-necessary, but also that servers did not have real-time state information about other servers (they had to query the database). This resulted in more load on the database and scaling issues. In MeshCentral, all live states are kept in the RAM which boosts performance significantly.
1788
-- Agentless Intel AMT Support – With MeshCentral1, administrators have to install the MeshAgent software on all computers, even if it was only for used for Intel AMT. MeshCentral supports a new agent-less mesh type that allows administrators to just setup the server strictly for Intel AMT only.
1789
-- Latest Security & Crypto algorithms – MeshCentral uses all the latest cryptographic algorithm, notably SHA384 and RSA3072 making it more resistant to future quantum computer attacks. This would be very difficult to retrofit into MeshCentralv1 since it would require change of database schema and 1000’s of line of code thus making the server incompatible with the current version version, making migration difficult.
1790
-- Support for Email Verification and Password Recovery – MeshCentral can be configured with an SMTP server to send out e-mail confirmation messages and password recovery message. This is an important feature that was missing in MeshCentral1.
1791
-- MeshInterceptor Support – MeshCentral can insert HTTP and Intel AMT redirection credential into a live data stream. This is useful to allow an administrator to securely pass Intel AMT password and control over an Intel AMT computer via web browser without the additional administrator login UI.
1919
+ ---
1920
+
1921
+ > **📌 Note :**
1922
+
1923
+ > MeshCentral will use `https://mesh.your.domain/auth-oidc-callback` as the default redirect uri.
1924
+
1925
+ ---
1926
+
1927
+## ✨ Improvements to MeshCentral
1928
+
1929
+In 2007, the first version of MeshCentral was built. We will refer to it as “MeshCentral1”. When MeshCentral1 was designed, HTML5 did not exist and web sockets where not implemented in any of the major browsers. Many design decisions were made at the time that are no longer optimal today. With the advent of the latest MeshCentral, MeshCentral1 is no longer supported and MeshCentral v2 has been significantly redesigned and mostly re-written based of previous version. Here is a list of improvements made in MeshCentral when compared with MeshCentral1 :
1930
+
1931
+- **Quick Installation –**
1932
+ > By having MeshCentral published on NPM (www.npmjs.com) it’s now easy to download and install MeshCentral on both Linux and Windows*. On Linux* you can use NPM directly (`npm install meshcentral`) and on Windows you can use the `.MSI installer`.
1933
+- **Cross-Platform Support –**
1934
+ > Contrary to MeshCentral1 that only runs on Windows*, MeshCentral can run on any environment that supports NodeJS. This includes Windows*, Linux* and *OSX*. Because MeshCentral runs on Linux, it often lowers hosting costs and makes it possible to run MeshCentral in a Docker* container environment.
1935
+- **Runs with Little Compute Resources –**
1936
+ > Typical MeshCentral1 installation requires a large disk space foot print (approx* 30G of disk space) and is compute intensive even for small deployments. MeshCentral requires little resources to host (70MB) and able to deliver reasonable performance on a 900Mhz CPU with 1GB RAM.
1937
+- **Multi-Tenancy and Load Balancing Support –**
1938
+ > MeshCentral can handle hosting many server instances at once. Each instance or `domain` has it’s own administrators, users and computers to manage. The server can handle each instance using a url path `server.com/customer1` or a DNS name `customer1.server.com`. Many customers can be handled by having all the DNS names point to the same server IP address. MeshCentral will take care of serving the right TLS certificate for each connection.
1939
+- **Single Executable –**
1940
+ > MeshCentral is a single-module or single executable server. All of the components of MeshCentral1 including IIS, Swarm, AJAX, Social, Manageability Servers are all build into one single executable. This makes it super easy to setup and run, it also minimizes problems and overhead caused by having many components communicate to each other. When the server is updated, all of the components are updated at once and effective.
1941
+- **Web Application Design –**
1942
+ > MeshCentral1 has 100’s of web pages and often times a click on a web page causes the browser to load a different web page and this creates more load on the server. With MeshCentral there are only two main web pages: The login page and the main web application. This design is much more responsive since the server now delegates most of the UI workload to the client’s web browser.
1943
+- **Real-Time User Interface –**
1944
+ > In MeshCentral, the user never has to hit the `refresh` button to update the web page. The web interface is completely real-time and updates as things change. MeshCentral uses websockets to connect to the server and get real-time events.
1945
+- **Single Programming Language –**
1946
+ > MeshCentral1 used JavaScript on the browser, C# on the server and C for the agent. Use of 3 different programming languages means that developers wanting to implement a new use-case needs to have sufficient skills to change between these 3 languages during the coding session. Makes the code significantly more difficult to understand and maintain.
1947
+- **Support for LAN only Mode –**
1948
+ > MeshCentral is capable of being setup as “LAN only” mode. In fact, this is the default mode when no static name or IP address is provided. In this mode, MeshAgents perform a multicast search on the network for the server making a static DNS/IP unnecessary.
1949
+- **Support for TLS Offloaders –**
1950
+ > TLS offloaders are now fully supported. This means that MeshCentral can handle way more network connections and traffic significantly.
1951
+- **Support for CIRA User/Pass Login –**
1952
+ > MeshCentral now supports both Intel AMT CIRA user/pass login and certificate login. Compared to MeshCentral1 that only supported certificate login, user/pass login is easier to setup and it can also be used for TLS offloaders and CIRA authentication.
1953
+- **No Live State Stored in the Database –**
1954
+ > One if the big problems with MeshCentral1 is that a lot of the live states (Agent, User and AMT connections and disconnections) needed to be stored in the database. This caused a few problems, first the extra load on the database that was un-necessary, but also that servers did not have real-time state information about other servers (they had to query the database). This resulted in more load on the database and scaling issues. In MeshCentral, all live states are kept in the RAM which boosts performance significantly.
1955
+- **Agentless Intel AMT Support –**
1956
+ > With MeshCentral1, administrators have to install the MeshAgent software on all computers, even if it was only for used for Intel AMT. MeshCentral supports a new agent-less mesh type that allows administrators to just setup the server strictly for Intel AMT only.
1957
+- **Latest Security & Crypto algorithms –**
1958
+ > MeshCentral uses all the latest cryptographic algorithm, notably SHA384 and RSA3072 making it more resistant to future quantum computer attacks. This would be very difficult to retrofit into MeshCentralv1 since it would require change of database schema and 1000’s of line of code thus making the server incompatible with the current version version, making migration difficult.
1959
+- **Support for Email Verification and Password Recovery –**
1960
+ > MeshCentral can be configured with an SMTP server to send out e-mail confirmation messages and password recovery message. This is an important feature that was missing in MeshCentral1.
1961
+- **MeshInterceptor Support –**
1962
+ > MeshCentral can insert HTTP and Intel AMT redirection credential into a live data stream. This is useful to allow an administrator to securely pass Intel AMT password and control over an Intel AMT computer via web browser without the additional administrator login UI.
1963
1964
It’s possible to perform migration to MeshCentral from MeshCentral1 server using a migration package. The MeshCentral Migration Tool will convert your existing user database into a format that can be imported into MeshCentral.
1965
1795
-
1966
+
1967
1968
In addition to the migration tool, MeshCentral has a special module that will update all MeshAgents from v1 to v2 so the transition should be simple.
1969
1799
-## Additional Resources
1970
+## 💡 Additional Resources
1971
1801
-In addition to this document, there are a growing set of MeshCentral tutorial videos available on YouTube which covers all of the basic at www.meshcommander.com/meshcentral2/tutorials. The tutorial includes videos on how to perform server installation using both the Windows MSI installer and NPM methods.
1972
+In addition to this document, there are a growing set of MeshCentral tutorial videos available on YouTube which covers all of the basic at [www.meshcommander.com/meshcentral2/tutorials](https://www.meshcommander.com/meshcentral2/tutorials)
1973
+. The tutorial includes videos on how to perform server installation using both the Windows MSI installer and NPM methods.
1974
1803
-
1975
+
1976
1805
-## Conclusion
1977
+## 🏁 Conclusion
1978
1979
MeshCentral is a free, open source and powerful remote management solution that is cross-platform. In this document, we have covered in detail on how to install and configure MeshCentral server to meet specific environment and use-case. MeshCentral works in many environments and situations. MeshCentral is not only simple to install but also takes minimal resources to host which makes it a very good remote management solution. As with any good software, MeshCentral will continue to be updated and evolve.
1980
2060
2061
When doing a remote terminal session to a Linux computer, it may be interesting to run the bash shell under a different user. One would typically use the command:
2062
1891
-```
2063
+```bash
2064
su -s /bin/bash myOtherUser
2065
```
2066
2067
However, because bash is not run in interactive mode, the command line prompt may be empty and history keys (up and down), tab and backspace will not work right. The correct command is:
2068
1897
-```
2069
+```bash
2070
su -c '/bin/bash -i' myOtherUser
2071
```
2072
2077
MeshCentral has built-in web-based integration of SSH in the "Terminal" tab and SFTP in the "Files" tab.
2078
2079
<div class="video-wrapper">
1908
- <iframe width="320" height="180" src="https://www.youtube.com/embed/7qAbl2OuZEU" frameborder="0" allowfullscreen></iframe>
2080
+ <iframe src="https://www.youtube.com/embed/7qAbl2OuZEU" frameborder="0" allowfullscreen></iframe>
2081
</div>
2082
+
2083
+## PDF and ODT handout(s).
2084
+
2085
+[MeshCentral Guide](https://meshcentral.com/docs/MeshCentral2UserGuide.pdf)
2086
+
2087
+MeshCmd Guide [as .pdf](https://meshcentral.com/docs/MeshCmdUserGuide.pdf) [as .odt](https://github.com/Ylianst/MeshCentral/blob/master/docs/MeshCentral User's Guide v0.2.9.odt?raw=true)
\ No newline at end of file