MeshCentral/meshcentral/index.html

4537 lines
230 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="A remote monitoring and management tool">
<meta name="author" content="Ylianst">
<link rel="canonical" href="https://ylianst.github.io/MeshCentral/meshcentral/">
<link rel="prev" href="../install/install2/">
<link rel="next" href="config/">
<link rel="icon" href="../images/favicon.ico">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">
<title>MeshCentral2 Guide - MeshCentral Documentation</title>
<link rel="stylesheet" href="../assets/stylesheets/main.8c3ca2c6.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../stylesheets/extra.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="white" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#meshcentral2-guide" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="MeshCentral Documentation" class="md-header__button md-logo" aria-label="MeshCentral Documentation" data-md-component="logo">
<img src="../images/favicon.ico" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
MeshCentral Documentation
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
MeshCentral2 Guide
</span>
</div>
</div>
</div>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/Ylianst/MeshCentral" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
Ylianst/MeshCentral
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href=".." class="md-tabs__link">
Home
</a>
</li>
<li class="md-tabs__item">
<a href="../install/" class="md-tabs__link">
Install
</a>
</li>
<li class="md-tabs__item md-tabs__item--active">
<a href="./" class="md-tabs__link">
MeshCentral2
</a>
</li>
<li class="md-tabs__item">
<a href="../design/" class="md-tabs__link">
Design and Architecture
</a>
</li>
<li class="md-tabs__item">
<a href="../meshcmd/" class="md-tabs__link">
MeshCmd
</a>
</li>
<li class="md-tabs__item">
<a href="../meshctrl/" class="md-tabs__link">
MeshCtrl
</a>
</li>
<li class="md-tabs__item">
<a href="../meshrouter/" class="md-tabs__link">
Mesh Router
</a>
</li>
<li class="md-tabs__item">
<a href="../intelamt/" class="md-tabs__link">
Intel AMT
</a>
</li>
<li class="md-tabs__item">
<a href="../how-to-contribute/" class="md-tabs__link">
How to Contribute
</a>
</li>
<li class="md-tabs__item">
<a href="../other/adfs_sso_guide/" class="md-tabs__link">
Other
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="MeshCentral Documentation" class="md-nav__button md-logo" aria-label="MeshCentral Documentation" data-md-component="logo">
<img src="../images/favicon.ico" alt="logo">
</a>
MeshCentral Documentation
</label>
<div class="md-nav__source">
<a href="https://github.com/Ylianst/MeshCentral" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
</div>
<div class="md-source__repository">
Ylianst/MeshCentral
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
<span class="md-ellipsis">
Home
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-ellipsis">
Install
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Install
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../install/" class="md-nav__link">
<span class="md-ellipsis">
Quick Start Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../install/install2/" class="md-nav__link">
<span class="md-ellipsis">
Full Install Guide
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
<span class="md-ellipsis">
MeshCentral2
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
MeshCentral2
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
MeshCentral2 Guide
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
MeshCentral2 Guide
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#video-walkthru" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthru
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#abstract" class="md-nav__link">
<span class="md-ellipsis">
Abstract
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#introduction" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-installation" class="md-nav__link">
<span class="md-ellipsis">
Server Installation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#basic-usage" class="md-nav__link">
<span class="md-ellipsis">
Basic Usage
</span>
</a>
<nav class="md-nav" aria-label="Basic Usage">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#launch" class="md-nav__link">
<span class="md-ellipsis">
Launch
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#create-account" class="md-nav__link">
<span class="md-ellipsis">
Create Account
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#new-device-group" class="md-nav__link">
<span class="md-ellipsis">
New device group
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#add-device" class="md-nav__link">
<span class="md-ellipsis">
Add device
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#after-agent-install" class="md-nav__link">
<span class="md-ellipsis">
After agent install
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manage-computer" class="md-nav__link">
<span class="md-ellipsis">
Manage Computer
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#desktop-control" class="md-nav__link">
<span class="md-ellipsis">
Desktop Control
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-certificate" class="md-nav__link">
<span class="md-ellipsis">
Server Certificate
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#files-and-folder-structure" class="md-nav__link">
<span class="md-ellipsis">
Files and Folder Structure
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
Server Configuration File
</span>
</a>
<nav class="md-nav" aria-label="Server Configuration File">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#settings" class="md-nav__link">
<span class="md-ellipsis">
Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#domains" class="md-nav__link">
<span class="md-ellipsis">
Domains
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-peering" class="md-nav__link">
<span class="md-ellipsis">
Server Peering
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#email-setup" class="md-nav__link">
<span class="md-ellipsis">
Email Setup
</span>
</a>
<nav class="md-nav" aria-label="Email Setup">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#smtp-userpass" class="md-nav__link">
<span class="md-ellipsis">
SMTP: User/Pass
</span>
</a>
<nav class="md-nav" aria-label="SMTP: User/Pass">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#normal-server" class="md-nav__link">
<span class="md-ellipsis">
Normal Server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#gmail" class="md-nav__link">
<span class="md-ellipsis">
Gmail
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#smtp-oauth-authentication" class="md-nav__link">
<span class="md-ellipsis">
SMTP: OAuth Authentication
</span>
</a>
<nav class="md-nav" aria-label="SMTP: OAuth Authentication">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#gmail_1" class="md-nav__link">
<span class="md-ellipsis">
Gmail
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#database" class="md-nav__link">
<span class="md-ellipsis">
Database
</span>
</a>
<nav class="md-nav" aria-label="Database">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#database-export" class="md-nav__link">
<span class="md-ellipsis">
Database Export
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#database-import" class="md-nav__link">
<span class="md-ellipsis">
Database Import
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#viewing-the-database" class="md-nav__link">
<span class="md-ellipsis">
Viewing the Database
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mongodb-setup" class="md-nav__link">
<span class="md-ellipsis">
MongoDB Setup
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#running-state-less" class="md-nav__link">
<span class="md-ellipsis">
Running State-less
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#commandline-options" class="md-nav__link">
<span class="md-ellipsis">
Commandline Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#tls-offloading" class="md-nav__link">
<span class="md-ellipsis">
TLS Offloading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lets-encrypt-support" class="md-nav__link">
<span class="md-ellipsis">
Lets Encrypt support
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-ip-filtering" class="md-nav__link">
<span class="md-ellipsis">
Server IP filtering
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#embedding-meshcentral" class="md-nav__link">
<span class="md-ellipsis">
Embedding MeshCentral
</span>
</a>
<nav class="md-nav" aria-label="Embedding MeshCentral">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#login-token" class="md-nav__link">
<span class="md-ellipsis">
Login Token
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#embedding-options" class="md-nav__link">
<span class="md-ellipsis">
Embedding Options
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-port-aliasing" class="md-nav__link">
<span class="md-ellipsis">
Server port aliasing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#web-relay-using-dns-names-and-multiple-web-relays" class="md-nav__link">
<span class="md-ellipsis">
Web relay using DNS names and multiple web relays
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#video-walkthrus" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthrus
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#device-groups-with-relay-agent" class="md-nav__link">
<span class="md-ellipsis">
Device Groups with Relay Agent
</span>
</a>
<nav class="md-nav" aria-label="Device Groups with Relay Agent">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#raritan-and-webpowerswitch-with-relay" class="md-nav__link">
<span class="md-ellipsis">
Raritan and WebPowerSwitch with Relay
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#nginx-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
NGINX Reverse-Proxy Setup
</span>
</a>
<nav class="md-nav" aria-label="NGINX Reverse-Proxy Setup">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#video-walkthru_1" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthru
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#cira-setup-with-nginx" class="md-nav__link">
<span class="md-ellipsis">
CIRA Setup with NGINX
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#traefik-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
Traefik Reverse-Proxy Setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#haproxy-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
HAProxy Reverse-Proxy Setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#running-in-a-production-environment" class="md-nav__link">
<span class="md-ellipsis">
Running in a Production Environment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#two-step-authentication" class="md-nav__link">
<span class="md-ellipsis">
Two step authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-backup-restore" class="md-nav__link">
<span class="md-ellipsis">
Server Backup &amp; Restore
</span>
</a>
<nav class="md-nav" aria-label="Server Backup & Restore">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#backup-to-google-drive" class="md-nav__link">
<span class="md-ellipsis">
Backup to Google Drive
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#hashicorp-vault-support" class="md-nav__link">
<span class="md-ellipsis">
HashiCorp Vault support
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#database-record-encryption" class="md-nav__link">
<span class="md-ellipsis">
Database Record Encryption
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mongodb-free-server-monitoring" class="md-nav__link">
<span class="md-ellipsis">
MongoDB free server monitoring
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshcentral-single-sign-on-sso" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Single Sign-On (SSO)
</span>
</a>
<nav class="md-nav" aria-label="MeshCentral Single Sign-On (SSO)">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ldap" class="md-nav__link">
<span class="md-ellipsis">
LDAP
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#twitter-authentication" class="md-nav__link">
<span class="md-ellipsis">
Twitter Authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#google-github-reddit-authentication" class="md-nav__link">
<span class="md-ellipsis">
Google, GitHub, Reddit Authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#microsoft-azure-active-directory" class="md-nav__link">
<span class="md-ellipsis">
Microsoft Azure Active Directory
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#jumpcloud-authentication-using-saml" class="md-nav__link">
<span class="md-ellipsis">
JumpCloud Authentication using SAML
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#generic-saml-setup" class="md-nav__link">
<span class="md-ellipsis">
Generic SAML setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#generic-openid-connect-setup" class="md-nav__link">
<span class="md-ellipsis">
Generic OpenID Connect Setup
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#improvements-to-meshcentral" class="md-nav__link">
<span class="md-ellipsis">
Improvements to MeshCentral
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#additional-resources" class="md-nav__link">
<span class="md-ellipsis">
Additional Resources
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#conclusion" class="md-nav__link">
<span class="md-ellipsis">
Conclusion
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#license" class="md-nav__link">
<span class="md-ellipsis">
License
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#annex-1-sample-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
Annex 1: Sample Configuration File
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#annex-2-tips-tricks" class="md-nav__link">
<span class="md-ellipsis">
Annex 2: Tips &amp; Tricks
</span>
</a>
<nav class="md-nav" aria-label="Annex 2: Tips & Tricks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#remote-terminal" class="md-nav__link">
<span class="md-ellipsis">
Remote Terminal
</span>
</a>
<nav class="md-nav" aria-label="Remote Terminal">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ssh-and-sftp-integration-to-the-terminal" class="md-nav__link">
<span class="md-ellipsis">
SSH and SFTP integration to the Terminal
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="config/" class="md-nav__link">
<span class="md-ellipsis">
All Configuration Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="agents/" class="md-nav__link">
<span class="md-ellipsis">
Agent Information
</span>
</a>
</li>
<li class="md-nav__item">
<a href="assistant/" class="md-nav__link">
<span class="md-ellipsis">
Assistant
</span>
</a>
</li>
<li class="md-nav__item">
<a href="codesigning/" class="md-nav__link">
<span class="md-ellipsis">
Code Signing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="debugging/" class="md-nav__link">
<span class="md-ellipsis">
Debugging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="devicetabs/" class="md-nav__link">
<span class="md-ellipsis">
Device Tabs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="plugins/" class="md-nav__link">
<span class="md-ellipsis">
Plugins
</span>
</a>
</li>
<li class="md-nav__item">
<a href="SSLnletsencrypt/" class="md-nav__link">
<span class="md-ellipsis">
SSL
</span>
</a>
</li>
<li class="md-nav__item">
<a href="security/" class="md-nav__link">
<span class="md-ellipsis">
Security
</span>
</a>
</li>
<li class="md-nav__item">
<a href="tokens/" class="md-nav__link">
<span class="md-ellipsis">
Tokens
</span>
</a>
</li>
<li class="md-nav__item">
<a href="faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="tipsntricks/" class="md-nav__link">
<span class="md-ellipsis">
Tips n Tricks
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../messaging/" class="md-nav__link">
<span class="md-ellipsis">
Messaging
</span>
</a>
</li>
<li class="md-nav__item">
<a href="customization/" class="md-nav__link">
<span class="md-ellipsis">
Customization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="openidConnectStrategy/" class="md-nav__link">
<span class="md-ellipsis">
openidConnectStrategy
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-ellipsis">
Design and Architecture
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Design and Architecture
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../design/" class="md-nav__link">
<span class="md-ellipsis">
Design and Architecture
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
MeshCmd
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
MeshCmd
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../meshcmd/" class="md-nav__link">
<span class="md-ellipsis">
MeshCmd
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
MeshCtrl
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
MeshCtrl
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../meshctrl/" class="md-nav__link">
<span class="md-ellipsis">
MeshCtrl
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Mesh Router
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Mesh Router
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../meshrouter/" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Router
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_8" >
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
<span class="md-ellipsis">
Intel AMT
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Intel AMT
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../intelamt/" class="md-nav__link">
<span class="md-ellipsis">
Intel AMT
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9" >
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
<span class="md-ellipsis">
How to Contribute
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
How to Contribute
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../how-to-contribute/" class="md-nav__link">
<span class="md-ellipsis">
Contribute to MeshCentral
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_10" >
<label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
<span class="md-ellipsis">
Other
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_10">
<span class="md-nav__icon md-icon"></span>
Other
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../other/adfs_sso_guide/" class="md-nav__link">
<span class="md-ellipsis">
ADFS SSO Guide
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../other/meshcentral_satellite/" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Satellite
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#video-walkthru" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthru
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#abstract" class="md-nav__link">
<span class="md-ellipsis">
Abstract
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#introduction" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-installation" class="md-nav__link">
<span class="md-ellipsis">
Server Installation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#basic-usage" class="md-nav__link">
<span class="md-ellipsis">
Basic Usage
</span>
</a>
<nav class="md-nav" aria-label="Basic Usage">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#launch" class="md-nav__link">
<span class="md-ellipsis">
Launch
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#create-account" class="md-nav__link">
<span class="md-ellipsis">
Create Account
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#new-device-group" class="md-nav__link">
<span class="md-ellipsis">
New device group
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#add-device" class="md-nav__link">
<span class="md-ellipsis">
Add device
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#after-agent-install" class="md-nav__link">
<span class="md-ellipsis">
After agent install
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manage-computer" class="md-nav__link">
<span class="md-ellipsis">
Manage Computer
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#desktop-control" class="md-nav__link">
<span class="md-ellipsis">
Desktop Control
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-certificate" class="md-nav__link">
<span class="md-ellipsis">
Server Certificate
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#files-and-folder-structure" class="md-nav__link">
<span class="md-ellipsis">
Files and Folder Structure
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
Server Configuration File
</span>
</a>
<nav class="md-nav" aria-label="Server Configuration File">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#settings" class="md-nav__link">
<span class="md-ellipsis">
Settings
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#domains" class="md-nav__link">
<span class="md-ellipsis">
Domains
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-peering" class="md-nav__link">
<span class="md-ellipsis">
Server Peering
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#email-setup" class="md-nav__link">
<span class="md-ellipsis">
Email Setup
</span>
</a>
<nav class="md-nav" aria-label="Email Setup">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#smtp-userpass" class="md-nav__link">
<span class="md-ellipsis">
SMTP: User/Pass
</span>
</a>
<nav class="md-nav" aria-label="SMTP: User/Pass">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#normal-server" class="md-nav__link">
<span class="md-ellipsis">
Normal Server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#gmail" class="md-nav__link">
<span class="md-ellipsis">
Gmail
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#smtp-oauth-authentication" class="md-nav__link">
<span class="md-ellipsis">
SMTP: OAuth Authentication
</span>
</a>
<nav class="md-nav" aria-label="SMTP: OAuth Authentication">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#gmail_1" class="md-nav__link">
<span class="md-ellipsis">
Gmail
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#database" class="md-nav__link">
<span class="md-ellipsis">
Database
</span>
</a>
<nav class="md-nav" aria-label="Database">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#database-export" class="md-nav__link">
<span class="md-ellipsis">
Database Export
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#database-import" class="md-nav__link">
<span class="md-ellipsis">
Database Import
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#viewing-the-database" class="md-nav__link">
<span class="md-ellipsis">
Viewing the Database
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mongodb-setup" class="md-nav__link">
<span class="md-ellipsis">
MongoDB Setup
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#running-state-less" class="md-nav__link">
<span class="md-ellipsis">
Running State-less
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#commandline-options" class="md-nav__link">
<span class="md-ellipsis">
Commandline Options
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#tls-offloading" class="md-nav__link">
<span class="md-ellipsis">
TLS Offloading
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lets-encrypt-support" class="md-nav__link">
<span class="md-ellipsis">
Lets Encrypt support
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-ip-filtering" class="md-nav__link">
<span class="md-ellipsis">
Server IP filtering
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#embedding-meshcentral" class="md-nav__link">
<span class="md-ellipsis">
Embedding MeshCentral
</span>
</a>
<nav class="md-nav" aria-label="Embedding MeshCentral">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#login-token" class="md-nav__link">
<span class="md-ellipsis">
Login Token
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#embedding-options" class="md-nav__link">
<span class="md-ellipsis">
Embedding Options
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#server-port-aliasing" class="md-nav__link">
<span class="md-ellipsis">
Server port aliasing
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#web-relay-using-dns-names-and-multiple-web-relays" class="md-nav__link">
<span class="md-ellipsis">
Web relay using DNS names and multiple web relays
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#video-walkthrus" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthrus
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#device-groups-with-relay-agent" class="md-nav__link">
<span class="md-ellipsis">
Device Groups with Relay Agent
</span>
</a>
<nav class="md-nav" aria-label="Device Groups with Relay Agent">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#raritan-and-webpowerswitch-with-relay" class="md-nav__link">
<span class="md-ellipsis">
Raritan and WebPowerSwitch with Relay
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#nginx-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
NGINX Reverse-Proxy Setup
</span>
</a>
<nav class="md-nav" aria-label="NGINX Reverse-Proxy Setup">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#video-walkthru_1" class="md-nav__link">
<span class="md-ellipsis">
Video Walkthru
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#cira-setup-with-nginx" class="md-nav__link">
<span class="md-ellipsis">
CIRA Setup with NGINX
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#traefik-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
Traefik Reverse-Proxy Setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#haproxy-reverse-proxy-setup" class="md-nav__link">
<span class="md-ellipsis">
HAProxy Reverse-Proxy Setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#running-in-a-production-environment" class="md-nav__link">
<span class="md-ellipsis">
Running in a Production Environment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#two-step-authentication" class="md-nav__link">
<span class="md-ellipsis">
Two step authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#server-backup-restore" class="md-nav__link">
<span class="md-ellipsis">
Server Backup &amp; Restore
</span>
</a>
<nav class="md-nav" aria-label="Server Backup & Restore">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#backup-to-google-drive" class="md-nav__link">
<span class="md-ellipsis">
Backup to Google Drive
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#hashicorp-vault-support" class="md-nav__link">
<span class="md-ellipsis">
HashiCorp Vault support
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#database-record-encryption" class="md-nav__link">
<span class="md-ellipsis">
Database Record Encryption
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#mongodb-free-server-monitoring" class="md-nav__link">
<span class="md-ellipsis">
MongoDB free server monitoring
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#meshcentral-single-sign-on-sso" class="md-nav__link">
<span class="md-ellipsis">
MeshCentral Single Sign-On (SSO)
</span>
</a>
<nav class="md-nav" aria-label="MeshCentral Single Sign-On (SSO)">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ldap" class="md-nav__link">
<span class="md-ellipsis">
LDAP
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#twitter-authentication" class="md-nav__link">
<span class="md-ellipsis">
Twitter Authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#google-github-reddit-authentication" class="md-nav__link">
<span class="md-ellipsis">
Google, GitHub, Reddit Authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#microsoft-azure-active-directory" class="md-nav__link">
<span class="md-ellipsis">
Microsoft Azure Active Directory
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#jumpcloud-authentication-using-saml" class="md-nav__link">
<span class="md-ellipsis">
JumpCloud Authentication using SAML
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#generic-saml-setup" class="md-nav__link">
<span class="md-ellipsis">
Generic SAML setup
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#generic-openid-connect-setup" class="md-nav__link">
<span class="md-ellipsis">
Generic OpenID Connect Setup
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#improvements-to-meshcentral" class="md-nav__link">
<span class="md-ellipsis">
Improvements to MeshCentral
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#additional-resources" class="md-nav__link">
<span class="md-ellipsis">
Additional Resources
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#conclusion" class="md-nav__link">
<span class="md-ellipsis">
Conclusion
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#license" class="md-nav__link">
<span class="md-ellipsis">
License
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#annex-1-sample-configuration-file" class="md-nav__link">
<span class="md-ellipsis">
Annex 1: Sample Configuration File
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#annex-2-tips-tricks" class="md-nav__link">
<span class="md-ellipsis">
Annex 2: Tips &amp; Tricks
</span>
</a>
<nav class="md-nav" aria-label="Annex 2: Tips & Tricks">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#remote-terminal" class="md-nav__link">
<span class="md-ellipsis">
Remote Terminal
</span>
</a>
<nav class="md-nav" aria-label="Remote Terminal">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ssh-and-sftp-integration-to-the-terminal" class="md-nav__link">
<span class="md-ellipsis">
SSH and SFTP integration to the Terminal
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="meshcentral2-guide">Meshcentral2 Guide<a class="headerlink" href="#meshcentral2-guide" title="Permanent link">&para;</a></h1>
<p><a href="https://meshcentral.com/docs/MeshCentral2UserGuide.pdf">MeshCentral2 Guide</a></p>
<p>MeshCmd Guide <a href="https://meshcentral.com/docs/MeshCmdUserGuide.pdf">as .pdf</a> <a href="https://github.com/Ylianst/MeshCentral/blob/master/docs/MeshCentral User's Guide v0.2.9.odt?raw=true">as .odt</a></p>
<h2 id="video-walkthru">Video Walkthru<a class="headerlink" href="#video-walkthru" title="Permanent link">&para;</a></h2>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/D9Q7M7PdTg0" frameborder="0" allowfullscreen></iframe>
</div>
<h2 id="abstract">Abstract<a class="headerlink" href="#abstract" title="Permanent link">&para;</a></h2>
<p>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.</p>
<h2 id="introduction">Introduction<a class="headerlink" href="#introduction" title="Permanent link">&para;</a></h2>
<p>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. </p>
<p><img alt="" src="images/2022-05-18-22-11-41.png" /></p>
<p>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. </p>
<p>At a high level, there are only four (4) main steps: Setup, Install, Connect and Control. </p>
<ol>
<li>Setup the MeshCentral server on VM or PC</li>
<li>Log on to MeshCentral portal with a valid account, creates an administrative mesh to collect all end-points (systems to be managed)</li>
<li>Generates an agent and installs it on a target or each end-point that immediately attempts a connection back to MeshCentral server. </li>
<li>Controls/manages assets or end-points that are available in respective administrative mesh</li>
</ol>
<h2 id="server-installation">Server Installation<a class="headerlink" href="#server-installation" title="Permanent link">&para;</a></h2>
<p>Because the MeshCentral server is written in NodeJS it can be installed on many operating systems including Windows, Linux. Please refer to the MeshCentral Installers Guide available at <a href="https://www.meshcommander.com/meshcentral2">https://www.meshcommander.com/meshcentral2</a> for information on how to install the server.</p>
<p>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. Its 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.</p>
<h2 id="basic-usage">Basic Usage<a class="headerlink" href="#basic-usage" title="Permanent link">&para;</a></h2>
<p>In this section we will cover the basics of MeshCentral in your newly setup server. </p>
<h3 id="launch">Launch<a class="headerlink" href="#launch" title="Permanent link">&para;</a></h3>
<p>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:
<img alt="" src="images/2022-05-18-22-16-11.png" /></p>
<p>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. </p>
<p>To proceed on Firefox browser,</p>
<ul>
<li>Click on “Advanced”, “Add Exception” and “Confirm Security Exception”</li>
</ul>
<p>To proceed on Chrome Browser,</p>
<ul>
<li>Click on “Advanced”, “Proceed to <a href="http://serverIP">http://serverIP</a> (unsafe)”</li>
</ul>
<p>Note: You can also get to a device by specifying the device name in the URL by adding <code>?viewmode=10&amp;gotodevicename=MyComputer</code> to the URL of the MeshCentral web page. The new <code>gotodevicename</code> will find a device with the specified name and navigate to that devices page. This is perfect for integrating MeshCentral with other solutions but be aware that a computer name is not a unique identifier and so, <code>&amp;gotonode=</code> is always the preferred way to access a device. This feature also works on the mobile web site.</p>
<h3 id="create-account">Create Account<a class="headerlink" href="#create-account" title="Permanent link">&para;</a></h3>
<p>Create an account by clicking “Create One” and click “Create Account” once the text fields had been populated correctly. </p>
<p><img alt="" src="images/2022-05-18-22-20-08.png" /></p>
<h3 id="new-device-group">New device group<a class="headerlink" href="#new-device-group" title="Permanent link">&para;</a></h3>
<p>Once logged in, create a new device group. This is a group of computers that we want to manage. To proceed, </p>
<ol>
<li>Click on “Click here to create a new group of devices”, </li>
<li>Key in a suitable “Name”, .e.g. “SampleGroup”</li>
<li>Leave “Type” to default “Manage using a software agent” and click OK”. </li>
</ol>
<p><img alt="" src="images/2022-05-18-22-23-59.png" /></p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>There are two types of groups: <br>
Software Agent Group: Commonly used to manage computers. Administrator must install a “remote management agent” on the remote computers. <br>
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”.</p>
</div>
<h3 id="add-device">Add device<a class="headerlink" href="#add-device" title="Permanent link">&para;</a></h3>
<p>To add devices into new mesh</p>
<ol>
<li>Click “Add Agent”, </li>
<li>Select the right Operating Systems (Windows* OS) and download the Mesh Agent executable. </li>
<li>Copy the Mesh Agent file into remote computers with Windows* OS
<img alt="" src="images/2022-05-18-22-25-39.png" /></li>
<li>Run Mesh Agent and Click “install”
<img alt="" src="images/2022-05-18-22-26-14.png" /></li>
</ol>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Mesh Agent is available for Windows* and Linux*. For Windows*, the mesh agent doesnt 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. </p>
</div>
<h3 id="after-agent-install">After agent install<a class="headerlink" href="#after-agent-install" title="Permanent link">&para;</a></h3>
<p>Once the agents are installed, it will take up to a minute before the computer shows up on the users account automatically. Click on each computer to access it and user can rename the each computer with a unique name and icons. </p>
<p><img alt="" src="images/2022-05-18-22-27-25.png" /></p>
<p><img alt="" src="images/2022-05-18-22-29-12.png" /></p>
<h3 id="manage-computer">Manage Computer<a class="headerlink" href="#manage-computer" title="Permanent link">&para;</a></h3>
<p>Click on any computer and go into the “Desktop” and “Files” tabs to remotely manage the computer or perform file transfer.</p>
<p><img alt="" src="images/2022-05-18-22-29-40.png" /></p>
<p><img alt="" src="images/2022-05-18-22-29-47.png" /></p>
<p>For advance users with console/command line interface experience, go into “Terminal” to perform scripting or quick tasks with CLI tools. </p>
<h3 id="desktop-control">Desktop Control<a class="headerlink" href="#desktop-control" title="Permanent link">&para;</a></h3>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/alknFiojQPM" frameborder="0" allowfullscreen></iframe>
</div>
<p>Depending on how the agent is connected to the server, there are multiple methods to remote control. Mesh Agent, RDP, and AMT</p>
<p>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 <code>General Tab</code> &gt; <code>Credentials</code>. Click pen to clear them.</p>
<h2 id="server-certificate">Server Certificate<a class="headerlink" href="#server-certificate" title="Permanent link">&para;</a></h2>
<p>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. </p>
<p>Users have few ways to handle this certificate warning:</p>
<ul>
<li>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.</li>
<li>Add webservers root certificate into web browsers 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. </li>
<li>If you own a domain name that points to your MeshCentral server, you can get a free trusted certificate using Lets Encrypt (https://letsencrypt.org/). See the section on Lets Encrypt in this document for more information on this option. MeshCentral has built-in support for Let Encrypt.</li>
</ul>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>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. </p>
</div>
<p>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.</p>
<ul>
<li>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. </li>
<li>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.</li>
</ul>
<p><strong>Note</strong>: If you are using TLS offloading, see the section on “TLS Offloading” cover in the latter parts of this document.</p>
<h2 id="files-and-folder-structure">Files and Folder Structure<a class="headerlink" href="#files-and-folder-structure" title="Permanent link">&para;</a></h2>
<p>Its important to know the basic file and folder structure from which MeshCentral was installed as shown below</p>
<p><img alt="" src="images/2022-05-18-22-32-35.png" /></p>
<p>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.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>User must periodically backup both meshcentral-data and meshcentral-files which contains all of servers data.</p>
</div>
<p>The “meshcentral-data” folder will contain:</p>
<p><strong>meshcentral.db file</strong>: The servers database file which contains all of the user and computer information. This includes account information and other sensitive information.</p>
<p><strong>Five .key and .crt files</strong>: These are the servers 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.</p>
<p><strong>config.json file</strong>: This is the servers 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.</p>
<p>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.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>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.</p>
</div>
<h2 id="server-configuration-file">Server Configuration File<a class="headerlink" href="#server-configuration-file" title="Permanent link">&para;</a></h2>
<p>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:</p>
<div class="highlight"><pre><span></span><code> {
&quot;settings&quot;: {
&quot;cert&quot;: &quot;mesh.myserver.com&quot;,
&quot;port&quot;: 8080,
&quot;redirport&quot;: 81
},
&quot;domains&quot;: {
&quot;&quot;: {
&quot;title&quot;: &quot;MyServer&quot;,
&quot;title2&quot;: &quot;Servername&quot;,
&quot;userQuota&quot;: 1048576,
&quot;meshQuota&quot;: 248576,
&quot;newAccounts&quot; : 1
},
&quot;Customer1&quot;: {
&quot;title&quot;: &quot;Customer1&quot;,
&quot;title2&quot;: &quot;Extra String&quot;,
&quot;newAccounts&quot; : 0
}
},
&quot;peers&quot;: {
&quot;serverId&quot; : &quot;Server1&quot;,
&quot;servers&quot;: {
&quot;Server1&quot;: { &quot;url&quot;: &quot;wss://192.168.1.100:443/&quot; },
&quot;Server2&quot;: { &quot;url&quot;: &quot;wss://192.168.1.101:443/&quot; }
}
}
}
</code></pre></div>
<p>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.</p>
<p><img alt="" src="images/2022-05-18_223720.png" /></p>
<h3 id="settings">Settings<a class="headerlink" href="#settings" title="Permanent link">&para;</a></h3>
<p>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. </p>
<table>
<thead>
<tr>
<th>Settings Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cert</td>
<td>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.</td>
</tr>
<tr>
<td>Port</td>
<td>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)</td>
</tr>
<tr>
<td>AliasPort</td>
<td>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.</td>
</tr>
<tr>
<td>RedirPort</td>
<td>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.</td>
</tr>
<tr>
<td>MpsPort</td>
<td>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.</td>
</tr>
<tr>
<td>TLSOffload</td>
<td>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.</td>
</tr>
<tr>
<td>SelfUpdate</td>
<td>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.</td>
</tr>
<tr>
<td>SessionKey</td>
<td>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.</td>
</tr>
<tr>
<td>Minify</td>
<td>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 "&amp;nominify=1" at the end of the URL will override this option.</td>
</tr>
<tr>
<td>User</td>
<td>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.</td>
</tr>
<tr>
<td>NoUsers</td>
<td>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</td>
</tr>
<tr>
<td>MpsCert</td>
<td>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.</td>
</tr>
<tr>
<td>MpsAliasPort</td>
<td>Specify an alias port for the MPS server. See the section on "Server port aliasing" for use of this option.</td>
</tr>
<tr>
<td>ExactPorts</td>
<td>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.</td>
</tr>
<tr>
<td>Lanonly</td>
<td>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.</td>
</tr>
<tr>
<td>Wanonly</td>
<td>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.</td>
</tr>
<tr>
<td>AllowFraming</td>
<td>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.</td>
</tr>
<tr>
<td>AllowLoginToken</td>
<td>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.</td>
</tr>
<tr>
<td>MongoDB</td>
<td>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.</td>
</tr>
<tr>
<td>MongoDBCol</td>
<td>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.</td>
</tr>
<tr>
<td>DbEncryptKey</td>
<td>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.</td>
</tr>
<tr>
<td>WebRTC</td>
<td>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.</td>
</tr>
<tr>
<td>ClickOnce</td>
<td>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.</td>
</tr>
</tbody>
</table>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Changes in config.json will NOT take effect until server is restarted. </p>
</div>
<p><strong>Note</strong>: We recommend the user to use a non-production server to experiment the setting options above. </p>
<h3 id="domains">Domains<a class="headerlink" href="#domains" title="Permanent link">&para;</a></h3>
<p>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:</p>
<p>https://servername:8080/ &lt;- default domain</p>
<p>https://servername:8080/customer1 &lt;- customer1 domain</p>
<p>https://servername:8080/customer2 &lt;- customer2 domain</p>
<p>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:</p>
<table>
<thead>
<tr>
<th>Sub Settings</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Title &amp; Title2</td>
<td>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</td>
</tr>
<tr>
<td>UserQuota</td>
<td>This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a user account.</td>
</tr>
<tr>
<td>MeshQuota</td>
<td>This is the maximum amount of data in kilobytes that can be placed in the “My Files” tab for a given mesh</td>
</tr>
<tr>
<td>NewAccounts</td>
<td>If set to zero (0)</td>
</tr>
<tr>
<td>UserAllowedIP</td>
<td>Allows user to set a list of allowed IP addresses. See section on server IP filtering.</td>
</tr>
<tr>
<td>Auth</td>
<td>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 users domain credentials.</td>
</tr>
<tr>
<td>Dns</td>
<td>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.</td>
</tr>
<tr>
<td>CertUrl</td>
<td>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.</td>
</tr>
<tr>
<td>PasswordRequirements</td>
<td>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><code>{ ""min"": 8, ""max"": 128, ""upper"": 1, ""lower"": 1, ""numeric"": 1, ""nonalpha"": 1 }</code><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.</td>
</tr>
</tbody>
</table>
<p><strong>Note</strong>: When the DNS value is set for a domain, user cant 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.</p>
<p>In this mode, the server will serve a different TLS certificate depending on what DNS record is used to access the server.</p>
<p><img alt="" src="images/2022-05-18-23-33-08.png" /></p>
<p>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”.</p>
<h2 id="server-peering">Server Peering<a class="headerlink" href="#server-peering" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p><img alt="" src="images/2022-05-18-23-34-22.png" /></p>
<p>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. </p>
<div class="admonition recommended">
<p class="admonition-title">Recommended</p>
<p>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)</p>
</div>
<p><img alt="" src="images/2022-05-18-23-35-19.png" /></p>
<p>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.</p>
<p>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. </p>
<div class="highlight"><pre><span></span><code> {
&quot;peers&quot;: {
&quot;serverId&quot; : &quot;Server1&quot;,
&quot;servers&quot;: {
&quot;Server1&quot;: { &quot;url&quot;: &quot;wss://192.168.1.100:443/&quot; },
&quot;Server2&quot;: { &quot;url&quot;: &quot;wss://192.168.1.101:443/&quot; }
}
}
}
</code></pre></div>
<p>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. </p>
<p>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://”. </p>
<p>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. </p>
<p>Once peered, all of the servers should act like one single host, no matter which server the user(s) are connected to.</p>
<h2 id="email-setup">Email Setup<a class="headerlink" href="#email-setup" title="Permanent link">&para;</a></h2>
<p>We highly recommend the use of an email server (SMTP) because we could allow MeshCentral to verify user accounts 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</p>
<p>A verification email is sent when a new account is created or if the user requests it in the “My Account” tab.</p>
<p><img alt="" src="images/2022-05-19-00-00-05.png" /></p>
<p>The password recovery flow when “Reset Account” is triggered at the login page.</p>
<p><img alt="" src="images/2022-05-19-00-00-18.png" /></p>
<p>Both account verification and password recovery are triggered automatically once SMTP mail server configuration is included into the config.json file.</p>
<h4 id="smtp-userpass">SMTP: User/Pass<a class="headerlink" href="#smtp-userpass" title="Permanent link">&para;</a></h4>
<h5 id="normal-server">Normal Server<a class="headerlink" href="#normal-server" title="Permanent link">&para;</a></h5>
<p>Update the config.json with “smtp” section as shown below and restart the server. </p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;smtp&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;host&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;smtp.server.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">25</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;from&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myaddress@server.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;user&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myaddress@server.com&quot;</span><span class="p">,</span><span class="w"> </span><span class="err">#</span><span class="w"> </span><span class="err">Op</span><span class="kc">t</span><span class="err">io</span><span class="kc">nal</span>
<span class="w"> </span><span class="nt">&quot;pass&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;mypassword&quot;</span><span class="p">,</span><span class="w"> </span><span class="err">#</span><span class="w"> </span><span class="err">Op</span><span class="kc">t</span><span class="err">io</span><span class="kc">nal</span>
<span class="w"> </span><span class="nt">&quot;tls&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="err">#</span><span class="w"> </span><span class="err">Op</span><span class="kc">t</span><span class="err">io</span><span class="kc">nal</span><span class="p">,</span><span class="w"> </span><span class="err">de</span><span class="kc">fault</span><span class="w"> </span><span class="kc">false</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>Please map the host, port values to connect to the right host that provides this SMTP service. For “from” value, administrators may put something like donotreply@server.com, but often times it needs to be a valid address since SMTP server will not send out messages with an invalid reply address. </p>
<p>Some SMTP servers will require a valid username and password to login to the mail server. This is to prevent unauthorized e-mail correspondence. TLS option can be set to true if the SMTP server requires TLS.</p>
<h5 id="gmail">Gmail<a class="headerlink" href="#gmail" title="Permanent link">&para;</a></h5>
<p>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 users 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. Its in the account settings, security section:</p>
<p><img alt="" src="images/2022-05-19-00-01-19.png" /></p>
<p>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 cant be used, its preferable to use a dedicated Google account for MeshCentral email.</p>
<h4 id="smtp-oauth-authentication">SMTP: OAuth Authentication<a class="headerlink" href="#smtp-oauth-authentication" title="Permanent link">&para;</a></h4>
<h5 id="gmail_1">Gmail<a class="headerlink" href="#gmail_1" title="Permanent link">&para;</a></h5>
<p>Google has announced that less secure app access will be phased out. For Google Workspace or G-Suite accounts, the following process can be used to allow OAuth2 based authentication with Google's SMTP server. It is likely a very similar process for regular Gmail accounts.</p>
<p>Start by visiting the Google API console:</p>
<p>https://console.developers.google.com/</p>
<p>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"</p>
<p><img alt="" src="images/gc-newproject.png" /></p>
<p>Click on the "OAuth Consent Screen" link, Under "APIs and Services" from the left hand menu:</p>
<p><img alt="" src="images/gc-oauthconsent.png" /></p>
<p>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. </p>
<p><img alt="" src="images/OAuth-Internal-External.png" /></p>
<p>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:</p>
<p><img alt="" src="images/gc-oauthscopes.png" /></p>
<p>Once this is complete, the next step will be to add credentials. </p>
<p><img alt="" src="images/gc-oauthcredentials.png" /></p>
<p>Choose OAuth Client</p>
<p>You will obtain a Client ID and a Client secret once you've completed the process. Be sure to store the secret immediately, as you won't be able to retreive it after you've dismissed the window.</p>
<p>Next, you will need to visit the Google OAuth Playground:</p>
<p>https://developers.google.com/oauthplayground</p>
<p><img alt="" src="images/gc-playground.webp" /></p>
<p>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.</p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>&quot;smtp&quot;: {
&quot;host&quot;: &quot;smtp.gmail.com&quot;,
&quot;port&quot;: 587,
&quot;from&quot;: &quot;my@googleaccount.com&quot;,
&quot;auth&quot;: {
&quot;clientId&quot;: &quot;&lt;YOUR-CLIENT-ID&gt;&quot;,
&quot;clientSecret&quot;: &quot;&lt;YOUR-CLIENT-SECRET&gt;&quot;,
&quot;refreshToken&quot;: &quot;&lt;YOUR-REFRESH-TOKEN&gt;&quot;
},
&quot;user&quot;: &quot;noreply@authorizedgooglealias.com&quot;,
&quot;emailDelaySeconds&quot;: 10,
&quot;tls&quot;: false,
&quot;verifyEmail&quot;: true
}
</code></pre></div>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-01-43.png" /></p>
<p>After successfully configuring the Gmail SMTP server, switch the OAuth 'Publishing Status' from <code>Testing</code> to <code>In Production</code>. This step prevents the need for frequent refresh token generation. Verification of your project isn't required to make this change.</p>
<p><img alt="" src="images/In-production.png" /></p>
<h2 id="database">Database<a class="headerlink" href="#database" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p>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.</p>
<h3 id="database-export">Database Export<a class="headerlink" href="#database-export" title="Permanent link">&para;</a></h3>
<p>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. </p>
<p>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.</p>
<p><img alt="" src="images/2022-05-18-23-37-31.png" /></p>
<p>Alternatively, user can also specify the full export path for the JSON file as shown below.</p>
<p><img alt="" src="images/2022-05-18-23-37-40.png" /></p>
<h3 id="database-import">Database Import<a class="headerlink" href="#database-import" title="Permanent link">&para;</a></h3>
<p>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.</p>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>Importing a JSON file will overwrite the entire content of the database. A starting empty database is recommended.</p>
</div>
<p>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. </p>
<p><img alt="" src="images/2022-05-18-23-38-45.png" /></p>
<p>Alternatively, user can specify the full path of the import JSON as shown below. </p>
<p><img alt="" src="images/2022-05-18-23-39-03.png" /></p>
<h3 id="viewing-the-database">Viewing the Database<a class="headerlink" href="#viewing-the-database" title="Permanent link">&para;</a></h3>
<p>For debugging purposes, Meshcentral allow users to have quick preview of certain frequently accessed data in the database with the following options:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>--showusers</td>
<td>List of all users in the database.</td>
</tr>
<tr>
<td>--showmeshes</td>
<td>List of all meshes in the database.</td>
</tr>
<tr>
<td>--shownodes</td>
<td>List of all nodes in the database</td>
</tr>
<tr>
<td>--showevents</td>
<td>List all events in the database</td>
</tr>
<tr>
<td>--showpower</td>
<td>List all power events in the database.</td>
</tr>
<tr>
<td>--showall</td>
<td>List all records in the database.</td>
</tr>
</tbody>
</table>
<p>For example, you can show the list of users with the “--showusers"</p>
<p><img alt="" src="images/2022-05-18-23-41-23.png" /></p>
<h3 id="mongodb-setup">MongoDB Setup<a class="headerlink" href="#mongodb-setup" title="Permanent link">&para;</a></h3>
<p>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.
In this guide, we will focus on the 64-bit windows with SSL support installer. </p>
<p><img alt="" src="images/2022-05-18-23-41-58.png" /></p>
<p>After completing the installation step,</p>
<ol>
<li>Stop any instance of Meshcentral that is running locally or in any machine</li>
<li>Start a terminal or Windows Command prompt (CMD), </li>
<li>Create a folder “c:\data\db” </li>
<li>
<p>Go to the MongoDB bin folder and run “mongod --bind 127.0.0.1”. </p>
<p>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”. </p>
<p><strong>Note</strong>: Refer to MongoDB documentation to allow database to run in the background or experiment with alternate configurations.</p>
<p><img alt="" src="images/2022-05-18-23-42-51.png" /></p>
<p><strong>Note</strong>: Upon successful execution, MongoDB will wait for connections on its default port 27017. </p>
</li>
<li>
<p>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.</p>
<div class="highlight"><pre><span></span><code>node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral
</code></pre></div>
<p><img alt="" src="images/2022-05-18-23-46-26.png" /></p>
</li>
<li>
<p>Alternatively, to transition an existing meshcentral DB from NeDB and to MongoDB, just run the command below:</p>
<div class="highlight"><pre><span></span><code>node meshcentral --dbexport
node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral --dbimport
node meshcentral --mongodb mongodb://127.0.0.1:27017/meshcentral
</code></pre></div>
</li>
<li>
<p>We recommend the user to include MongoDB configuration into the servers configuration “config.json” to avoid specifying the “--mongodb" each time MeshCentral is executed as shown below </p>
<div class="highlight"><pre><span></span><code>{
&quot;settings&quot;: {
&quot;mongodb&quot;: &quot;mongodb://127.0.0.1:27017/meshcentral&quot;,
&quot;mongodbcol&quot;: &quot;meshcentral&quot;
}
}
</code></pre></div>
</li>
</ol>
<p><strong>Note</strong>: 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.</p>
<p>If you are using MongoDB with authentication, you can change the URL a little to add the username and password, for example:</p>
<div class="highlight"><pre><span></span><code>mongodb://username:password@127.0.0.1:27017/meshcentral
</code></pre></div>
<p>You can also provide extra connection parameters like this:</p>
<div class="highlight"><pre><span></span><code>mongodb://username:password@127.0.0.1:27017/meshcentral?authMechanism=MONGODB-CR&amp;authSource=db
</code></pre></div>
<h2 id="running-state-less">Running State-less<a class="headerlink" href="#running-state-less" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p><img alt="" src="images/2022-05-18-23-49-37.png" /></p>
<p>After the configuration is read, MeshCentral will connect to its database and continue to start the server. For most users this is a perfectly acceptable way to setup the server. However, in some cases, its 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 dont 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.</p>
<p><img alt="" src="images/2022-05-18-23-49-53.png" /></p>
<p>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.</p>
<p>To make this happen, we will be using the following command line options from MeshCentral:</p>
<table>
<thead>
<tr>
<th>Command</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>--configkey (key)</td>
<td>Specifies the encryption password that will be used to read or write the configuration files to the database.</td>
</tr>
<tr>
<td>--dblistconfigfiles</td>
<td>List the names and size of all configuration files in the database.</td>
</tr>
<tr>
<td>--dbshowconfigfile (filename)</td>
<td>Show the content of a specified filename from the database. --configkey is required.</td>
</tr>
<tr>
<td>--dbdeleteconfigfiles</td>
<td>Delete all configuration files from the database.</td>
</tr>
<tr>
<td>--dbpushconfigfiles '*' or (folder path)</td>
<td>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.</td>
</tr>
<tr>
<td>--dbpullconfigfiles (folder path)</td>
<td>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.</td>
</tr>
<tr>
<td>--loadconfigfromdb (key)</td>
<td>Runs MeshCentral server using the configuration files found in the database. The configkey may be specified with this command or --configkey can be used.</td>
</tr>
</tbody>
</table>
<p>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:</p>
<div class="highlight"><pre><span></span><code>node ./node_modules/meshcentral --dbpushconfigfiles &#39;*&#39; --configkey mypassword
node ./node_modules/meshcentral --loadconfigfromdb mypassword --mongodb &quot;mongodb://127.0.0.1:27017/meshcentral&quot;
</code></pre></div>
<p>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.</p>
<p>Note that MeshCentral does not currently support placing a Lets Encrypt certificate in the database. Generally, one would use a reverse proxy with Lets Encrypt support and TLS offload in the reverse proxy and then run MeshCentral in state-less mode in a Docket container.</p>
<h2 id="commandline-options">Commandline Options<a class="headerlink" href="#commandline-options" title="Permanent link">&para;</a></h2>
<p>In general, doing <code>--option value</code> is the same as adding <code>"option": value</code> in the settings section of the config.json.</p>
<p>Here are the most common options found by running <code>meshcentral --help</code></p>
<div class="highlight"><pre><span></span><code>Run as a background service
--install/uninstall Install MeshCentral as a background service.
--start/stop/restart Control MeshCentral background service.
Run standalone, console application
--user [username] Always login as [username] if account exists.
--port [number] Web server port number.
--redirport [number] Creates an additional HTTP server to redirect users to the HTTPS server.
--exactports Server must run with correct ports or exit.
--noagentupdate Server will not update mesh agent native binaries.
--nedbtodb Transfer all NeDB records into current database.
--listuserids Show a list of a user identifiers in the database.
--cert [name], (country), (org) Create a web server certificate with [name] server name.
country and organization can optionally be set.
Server recovery commands, use only when MeshCentral is offline.
--createaccount [userid] Create a new user account.
--resetaccount [userid] Unlock an account, disable 2FA and set a new account password.
--adminaccount [userid] Promote account to site administrator.
</code></pre></div>
<h2 id="tls-offloading">TLS Offloading<a class="headerlink" href="#tls-offloading" title="Permanent link">&para;</a></h2>
<p>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. </p>
<p>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.</p>
<p><img alt="" src="images/2022-05-18-23-53-04.png" /></p>
<p>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. </p>
<p>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 devices ports and functions should be configured correctly like below </p>
<table>
<thead>
<tr>
<th>Port</th>
<th>Function Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>80</td>
<td>Directly forwards port 80 to MeshCentral port 80</td>
</tr>
<tr>
<td>443</td>
<td>Handle TLS using a web certificate and forward to MeshCentral port 443</td>
</tr>
<tr>
<td>4433</td>
<td>Handle TLS using MPS certificate and forward to MeshCentral port 4433</td>
</tr>
</tbody>
</table>
<p>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.</p>
<p>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. </p>
<p>Note: Please consult the TLS offloader user manual from the respective vendor to configure TLS offloading feature correctly. </p>
<h2 id="lets-encrypt-support">Lets Encrypt support<a class="headerlink" href="#lets-encrypt-support" title="Permanent link">&para;</a></h2>
<p>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 Lets Encrypt (https://letsencrypt.org/). There are some limitations and so, its 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.</p>
<p><img alt="" src="images/2022-05-18-23-55-26.png" /></p>
<p>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. MeshCentrals HTTP port 80 server will be used in the process to prove to Lets 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:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span><span class="p">,</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;letsencrypt&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;email&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myemail@myserver.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;names&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;domain1.com,domain2.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;rsaKeySize&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">3072</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;production&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span>
<span class="w"> </span><span class="p">},</span>
<span class="p">}</span>
</code></pre></div>
<p>The only mandatory field is the email address, please enter a valid one.</p>
<p>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. Its important to understand you are not requesting these DNS names, rather, Lets 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 dont specify names, the default MeshCentral certificate name is used, that is the configured “--cert [name]”.</p>
<p>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.</p>
<p>Lastly the production key, by default this is false. When set to false, MeshCentral will query the Lets Encrypt staging server for a certificate. Its highly recommended to try this first and make sure everything works before getting a real certificate. Keep production to false, run thru the process at least once and make sure everything works. You will get a new certificate installed on the HTTPS server signed by a staging Lets Encrypt certificate authority.</p>
<p>The Lets 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.</p>
<p><img alt="" src="images/2022-05-18-23-56-29.png" /></p>
<p>Once you placed the “letsencrypt” section in config.json, restart the server. The request to the Lets Encrypt server may take a few minutes to a few hours. Its 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:</p>
<p><img alt="" src="images/2022-05-18-23-56-59.png" /></p>
<p>If you successfully setup a Lets Encrypt certificate using the Lets 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 Lets Encrypt certificate to the “meshcentral-data” folder. If something goes wrong with the Lets Encrypt certificate, the server will fall back to using the self-signed one.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Please be patient with Lets Encrypt certificate requests and make sure you correctly get a staging certificate before setting production to true.</p>
</div>
<p>If Lets Encrypt works for you, please consider donating to them as they provide a critical service to the Internet community.</p>
<h2 id="server-ip-filtering">Server IP filtering<a class="headerlink" href="#server-ip-filtering" title="Permanent link">&para;</a></h2>
<p>For improved security, its 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. </p>
<p>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.</p>
<div class="highlight"><pre><span></span><code> {
&quot;domains&quot;: {
&quot;&quot;: {
&quot;userallowedip&quot; : &quot;1.2.3.4,1.2.3.5&quot;,
}
}
}
</code></pre></div>
<p>IP addresses are separated by a comma. As a result, only users coming these IP addresses will be able to see the servers login page as illustrated below. Other IP addresses will be blocked effectively.</p>
<p><img alt="" src="images/2022-05-18-23-59-28.png" /></p>
<p><strong>Note</strong>: When IP address whitelist is effective, Mesh Agent connection from any IP address will be not affected. </p>
<p>You can also use files for IP lists</p>
<div class="highlight"><pre><span></span><code><span class="nt">&quot;userAllowedIp&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;file:userallowedips.txt&quot;</span><span class="p">,</span>
<span class="nt">&quot;userBlockedIp&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;file:userblockedips.txt&quot;</span><span class="p">,</span>
<span class="nt">&quot;agentAllowedIp&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;file:agentallowedips.txt&quot;</span>
</code></pre></div>
<p>Place the file in the <code>meshcentral-data</code> folder.</p>
<p>All the lines that start with a number or <code>:</code> will be used, everything else is ignored. So, you can put comments anyway you like, but probably best to start then with a <code>#</code> or something to make it clear.</p>
<div class="highlight"><pre><span></span><code># My list of blocked IP&#39;s
185.101.70.0/24
185.46.85.0/24
37.9.44.0/24
37.9.45.0/24
5.189.205.0/24
5.189.206.0/24
5.189.207.0/24
5.62.153.0/24
5.62.156.0/24
5.62.158.0/24
# One more list
5.8.44.0/24
5.8.45.0/24
5.8.46.0/24
79.110.28.0/24
79.110.31.0/24
91.204.14.0/24
95.181.218.0/24
95.85.81.0/24
</code></pre></div>
<h2 id="embedding-meshcentral">Embedding MeshCentral<a class="headerlink" href="#embedding-meshcentral" title="Permanent link">&para;</a></h2>
<p>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. </p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-02-03.png" /></p>
<p>To make this work, a following key alignment is required:<br />
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.
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.
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. </p>
<p>In this section we will review both the login token and embedding options mentioned above. </p>
<h3 id="login-token">Login Token<a class="headerlink" href="#login-token" title="Permanent link">&para;</a></h3>
<p>With MeshCentral, its 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.</p>
<p>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. </p>
<p>To enable this feature, configure config.json file to allow login tokens. </p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;allowLoginToken&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;allowFraming&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>Set both allowLoginToken and allowFraming to true to use login tokens along with framing MeshCentral within another web page. </p>
<p>Next, create a token. Execute MeshCentral with the “--logintoken [userid]” switch and userid value with the example below:</p>
<p><img alt="" src="images/2022-05-19-00-03-32.png" /></p>
<p>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.</p>
<p>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. </p>
<p>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</p>
<p><img alt="" src="images/2022-05-19-00-03-46.png" /></p>
<p>The generated masker key must be placed in a secure location within the business website. </p>
<p><img alt="" src="images/2022-05-19-00-03-58.png" /></p>
<p>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 users 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. </p>
<h3 id="embedding-options">Embedding Options<a class="headerlink" href="#embedding-options" title="Permanent link">&para;</a></h3>
<p>There are multiple options available for user to explicitly choose the features that will be loaded from MeshCentral to the business website. The argument in the in the URL can dictate which web page should display and how. The three embedding URL arguments are Viewmode, Hide and Node. </p>
<table>
<thead>
<tr>
<th>Embedding Options / URL Argument</th>
<th>Description</th>
<th>"Values<br><br><strong>Note</strong>: For values 10 and above, a node identifier must be specified."</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>viewmode</strong></td>
<td>"Indicates the information to show. <br>This is an integer value, possible values are:"</td>
<td>"1 = Devices tab<br><br>2 = Account tab<br><br>3 = Events tab<br><br>4 = Users tab (Site admins only)<br><br>5 = Server files tab<br><br>10 = Device general information<br><br>11 = Device remote desktop<br><br>12 = Device terminal<br><br>14 = Device Intel AMT console.<br><br>15 = Device Mesh Agent console</td>
</tr>
<tr>
<td><strong>hide</strong></td>
<td>"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.</td>
<td>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</td>
</tr>
<tr>
<td><strong>node</strong></td>
<td>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&amp;viewmode=11&amp;hide=15"</td>
<td>Node or NodeID is a long base64 encoded SHA384 value</td>
</tr>
</tbody>
</table>
<p><strong>Note</strong>: Typically, the URL for the website is followed by “?” then a set of name=value pairs separated by “&amp;”.</p>
<p>Based on the URL https://localhost/?node=UkSNlz7t...2Sve6Srl6FltDd&amp;viewmode=11&amp;hide=15 , the nodeID starts with “UkSNlz7t”. We shortened the value in this example, but its 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. </p>
<p><img alt="" src="images/2022-05-19-00-19-29.png" /></p>
<p>Only the remote desktop viewer will be displayed embedded within an iframe. </p>
<p><strong>Note</strong>: 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. </p>
<h2 id="server-port-aliasing">Server port aliasing<a class="headerlink" href="#server-port-aliasing" title="Permanent link">&para;</a></h2>
<p>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 its using the other standard ports when communicating publicly. To make this work, MeshCentral supports port aliasing.</p>
<p>For example you can run:</p>
<div class="highlight"><pre><span></span><code> node meshcentral --redirport 2001 --port 2002 --aliasport 443
</code></pre></div>
<p><img alt="" src="images/2022-05-19-00-19-46.png" /></p>
<p>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.</p>
<p>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.</p>
<p>In the following picture we have a usual server running with:</p>
<div class="highlight"><pre><span></span><code>node meshcentral --cert Server1 --port 443 --mpsport 4433
</code></pre></div>
<p><img alt="" src="images/2022-05-19-00-21-19.png" /></p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>node meshcentral --cert Server1 --mpscert Server2
--port 443 --mpsport 4433 --mpsaliasport 443
</code></pre></div>
<p><img alt="" src="images/2022-05-19-00-21-54.png" /></p>
<p>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”.</p>
<p>A router or firewall that is located in front of the MeshCentral server needs to be configured correctly to forwarding:</p>
<div class="highlight"><pre><span></span><code>Server1:443 -&gt; 443 on MeshCentral
Server2:443 -&gt; 4433 on MeshCentral
</code></pre></div>
<p>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.</p>
<h2 id="web-relay-using-dns-names-and-multiple-web-relays">Web relay using DNS names and multiple web relays<a class="headerlink" href="#web-relay-using-dns-names-and-multiple-web-relays" title="Permanent link">&para;</a></h2>
<p>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.</p>
<h2 id="video-walkthrus">Video Walkthrus<a class="headerlink" href="#video-walkthrus" title="Permanent link">&para;</a></h2>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/GU7MQjkPSd8" frameborder="0" allowfullscreen></iframe>
<iframe width="320" height="180" src="https://www.youtube.com/embed/INOvsHXNOKY" frameborder="0" allowfullscreen></iframe>
</div>
<h2 id="device-groups-with-relay-agent">Device Groups with Relay Agent<a class="headerlink" href="#device-groups-with-relay-agent" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p><img alt="" src="images/2022-05-31-10-30-07.png" /></p>
<p><img alt="" src="images/2022-05-31-10-30-42.png" /></p>
<p>To enable SSH support, add this line to the domain section of your config.json:</p>
<div class="highlight"><pre><span></span><code><span class="nt">&quot;ssh&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
</code></pre></div>
<p>Video Walkthru</p>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/TtW5-g6SeZQ" frameborder="0" allowfullscreen></iframe>
</div>
<h3 id="raritan-and-webpowerswitch-with-relay">Raritan and WebPowerSwitch with Relay<a class="headerlink" href="#raritan-and-webpowerswitch-with-relay" title="Permanent link">&para;</a></h3>
<p>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.</p>
<p><img alt="" src="images/2022-05-31-10-30-50.png" /></p>
<p><img alt="" src="images/2022-05-31-10-31-00.png" /></p>
<p><img alt="" src="images/2022-05-31-10-32-46.png" /></p>
<h2 id="nginx-reverse-proxy-setup">NGINX Reverse-Proxy Setup<a class="headerlink" href="#nginx-reverse-proxy-setup" title="Permanent link">&para;</a></h2>
<h3 id="video-walkthru_1">Video Walkthru<a class="headerlink" href="#video-walkthru_1" title="Permanent link">&para;</a></h3>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/YSmiLyKSX2I" frameborder="0" allowfullscreen></iframe>
</div>
<p>Sometimes its 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/</p>
<p><img alt="" src="images/2022-05-19-00-23-11.png" /></p>
<p>In this example, we will:</p>
<ul>
<li>MeshCentral on non-standard ports, but alias HTTPS to port 443.</li>
<li>NGINX will be using standard ports 80 and 443.</li>
<li>We will have NGINX perform all TLS authentication &amp; encryption.</li>
<li>MeshCentral will read the NGINX web certificate so agents will perform correct server authentication.</li>
<li>NGINX will be setup with long timeouts, because agents have long standard web socket connections.</li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>With SELinux, NGINX reverse proxy requires 'setsebool -P httpd_can_network_relay 1'
Caution: httpd_can_network_relay only allows certain ports
Confirm you are using ports from this subset in MeshCentral
If you want to use a different port then you will need to add it to http_port_t</p>
</div>
<p>Lets get started by configuring MeshCentral with the following values in config.json:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myservername.domain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4430</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AliasPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">800</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AgentPong&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">300</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;TlsOffload&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;certUrl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://127.0.0.1:443/&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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”.</p>
<p>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.</p>
<p>When agents connect, they will see the NGINX TLS certificate on port 443. MeshCentral needs to know about the NGINX certificate so that it can tell the agents this is the correct certificate they should expect to see. So, “certUrl” is used to tell MeshCentral where to get the certificates that agents will see when connecting.</p>
<p>When NGINX forwards connections to MeshCentral, extra X-Forwarded headers will be added to each request. MeshCentral needs to know if these headers can be trusted or not. By setting “TlsOffload” to “127.0.0.1”, MeshCentral is told to trust these headers when requests come from “127.0.0.1”.</p>
<p>In this example, make sure to change “127.0.0.1” to the IP address of NGINX and “Cert” to the external DNS name of the NGINX server.</p>
<p>Next, we need to configure and launch NGINX. Here is an ngnix.conf to get started:</p>
<div class="highlight"><pre><span></span><code>worker_processes 1;
events {
worker_connections 1024;
}
http {
# HTTP server. In this example, we use a wildcard as server name.
server {
listen 80;
server_name _;
location / {
proxy_pass http://127.0.0.1:800/;
proxy_http_version 1.1;
# Inform MeshCentral about the real host, port and protocol
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# HTTPS server. In this example, we use a wildcard as server name.
server {
listen 443 ssl;
server_name _;
# MeshCentral uses long standing web socket connections, set longer timeouts.
proxy_send_timeout 330s;
proxy_read_timeout 330s;
# We can use the MeshCentral generated certificate &amp; key
ssl_certificate webserver-cert-public.crt;
ssl_certificate_key webserver-cert-private.key;
ssl_session_cache shared:WEBSSL:10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:4430/;
proxy_http_version 1.1;
# Allows websockets over HTTPS.
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection &quot;upgrade&quot;;
proxy_set_header Host $host;
# Inform MeshCentral about the real host, port and protocol
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
</code></pre></div>
<p>As indicated in the comments of this NGINX configuration file, we set timeouts to be really long. We forward HTTP port 80 and HTTPS port 443 to the corresponding ports on MeshCentral. In this example, we happen to use the web certificates that where generated by MeshCentral, but any certificate is ok. We also add extra “X-Forward” headers, this tells MeshCentral information that would normally be hidden by NGINX, like the clients IP address and more.</p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>MeshCentral HTTP redirection web server running on port 800.
Loaded RSA web certificate at https://127.0.0.1:443/, SHA384: d9de9e27a229b5355708a3672fb23237cc994a680b3570d242a91e36b4ae5bc96539e59746e2b71eef3dbdabbf2ae138.
MeshCentral Intel(R) AMT server running on myservername.domain.com:4433.
MeshCentral HTTP web server running on port 4430, alias port 443.
</code></pre></div>
<p>Notice on the second line, MeshCentral will have loaded the web certificate from NGNIX and display a matching hash. That is it, navigating to port 80 and 443 on NGINX should show the MeshCentral web page and agents should connect as expected.</p>
<h3 id="cira-setup-with-nginx">CIRA Setup with NGINX<a class="headerlink" href="#cira-setup-with-nginx" title="Permanent link">&para;</a></h3>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-25-11.png" /></p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>stream {
# Internal MPS servers, in this case we use one MeshCentral MPS server is on our own computer.
upstream mpsservers {
server 127.0.0.1:44330 max_fails=3 fail_timeout=30s;
}
# We can use the MeshCentral generated MPS certificate &amp; key
ssl_certificate mpsserver-cert-public.crt;
ssl_certificate_key mpsserver-cert-private.key;
ssl_session_cache shared:MPSSSL:10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
# MPS server.
server {
listen 4433 ssl;
proxy_pass mpsservers;
proxy_next_upstream on;
}
}
NGINX will listen on port 4433, decrypt the connection and forward it to 44330 on the loopback interface. We are going to be used the “mpsserver” certificate that was created by MeshCentral as the TLS server certificate for port 4433. Now, we just have to make a few changes to the MeshCentral config.json file.
{
&quot;settings&quot;: {
&quot;Cert&quot;: &quot;myservername.domain.com&quot;
&quot;Port&quot;: 4430,
&quot;AliasPort&quot;: 443,
&quot;RedirPort&quot;: 800,
&quot;TlsOffload&quot;: &quot;127.0.0.1&quot;
&quot;MpsPort&quot;: 44330,
&quot;MpsAliasPort&quot;: 4433,
&quot;MpsTlsOffload&quot;: true
},
&quot;domains&quot;: {
&quot;&quot;: {
&quot;certUrl&quot;: &quot;https://127.0.0.1:443/&quot;
}
}
}
</code></pre></div>
<p>In this new config.json, we added 3 lines. First, the MeshCentral Management Presence Server (MPS) is now on port 44330. However, the MpsAliasPort value indicates that externally, port 4433 will be used, so we need to configure Intel AMT to connect to port 4433. Lastly, we want to disable TLS support on port 44330 by setting “MpsTlsOffload” to true.</p>
<p>With this configuration, Intel AMT CIRA connections will come in and TLS will be handled by NGINX. With this setup, its not possible to configure Intel AMT CIRA to connect using mutual-TLS authentication, only username/password authentication is used.</p>
<h2 id="traefik-reverse-proxy-setup">Traefik Reverse-Proxy Setup<a class="headerlink" href="#traefik-reverse-proxy-setup" title="Permanent link">&para;</a></h2>
<p>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/</p>
<p>This section covers a really simple Traefik configuration. Traefik is capable of a lot more complex configurations.</p>
<p><img alt="" src="images/2022-05-19-00-32-32.png" /></p>
<p>In this example, we will:</p>
<ul>
<li>MeshCentral on non-standard ports, but alias HTTPS to port 443.</li>
<li>Traefik will be using standard ports 80 and 443.</li>
<li>We will have Traefik perform all TLS authentication &amp; encryption.</li>
<li>MeshCentral will read the NGINX web certificate so agents will perform correct server authentication.</li>
</ul>
<p>First we will start with the MeshCentral configuration, here is a minimal configuration that will work:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myservername.domain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4430</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AliasPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">800</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;TlsOffload&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;certUrl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://127.0.0.1:443/&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p><strong>Note the “agentConfig” line</strong>: 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.</p>
<p>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.</p>
<p>Now that we have MeshCentral setup, lets 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:</p>
<div class="highlight"><pre><span></span><code><span class="p">[</span><span class="err">global</span><span class="p">]</span>
<span class="w"> </span><span class="err">checkNewVersio</span><span class="kc">n</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="kc">false</span>
<span class="w"> </span><span class="err">se</span><span class="kc">n</span><span class="err">dA</span><span class="kc">n</span><span class="err">o</span><span class="kc">n</span><span class="err">ymousUsage</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="kc">false</span>
<span class="p">[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="err">.h</span><span class="kc">tt</span><span class="err">p</span><span class="p">]</span>
<span class="w"> </span><span class="err">address</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;:80&quot;</span>
<span class="w"> </span><span class="p">[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="err">.h</span><span class="kc">tt</span><span class="err">p.redirec</span><span class="kc">t</span><span class="p">]</span>
<span class="w"> </span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nt</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;https&quot;</span>
<span class="w"> </span><span class="p">[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="err">.h</span><span class="kc">tt</span><span class="err">ps</span><span class="p">]</span>
<span class="w"> </span><span class="err">address</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;:443&quot;</span>
<span class="w"> </span><span class="p">[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="err">.h</span><span class="kc">tt</span><span class="err">ps.</span><span class="kc">tls</span><span class="p">]</span>
<span class="w"> </span><span class="p">[[</span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="err">.h</span><span class="kc">tt</span><span class="err">ps.</span><span class="kc">tls</span><span class="err">.cer</span><span class="kc">t</span><span class="err">i</span><span class="kc">f</span><span class="err">ica</span><span class="kc">tes</span><span class="p">]]</span>
<span class="w"> </span><span class="err">cer</span><span class="kc">t</span><span class="err">File</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;webserver-cert-public.crt&quot;</span>
<span class="w"> </span><span class="err">keyFile</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;webserver-cert-private.key&quot;</span>
<span class="p">[</span><span class="kc">f</span><span class="err">ile</span><span class="p">]</span>
<span class="p">[</span><span class="err">backe</span><span class="kc">n</span><span class="err">ds</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="err">backe</span><span class="kc">n</span><span class="err">ds.backe</span><span class="kc">n</span><span class="err">d</span><span class="mi">1</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="err">backe</span><span class="kc">n</span><span class="err">ds.backe</span><span class="kc">n</span><span class="err">d</span><span class="mf">1.</span><span class="err">heal</span><span class="kc">t</span><span class="err">hcheck</span><span class="p">]</span>
<span class="w"> </span><span class="err">pa</span><span class="kc">t</span><span class="err">h</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;/health.ashx&quot;</span>
<span class="w"> </span><span class="err">i</span><span class="kc">nter</span><span class="err">val</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;30s&quot;</span>
<span class="w"> </span><span class="p">[</span><span class="err">backe</span><span class="kc">n</span><span class="err">ds.backe</span><span class="kc">n</span><span class="err">d</span><span class="mf">1.</span><span class="err">servers.server</span><span class="mi">1</span><span class="p">]</span>
<span class="w"> </span><span class="err">url</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;http://127.0.0.1:4430&quot;</span>
<span class="w"> </span><span class="err">weigh</span><span class="kc">t</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="mi">1</span>
<span class="p">[</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">ds</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">ds.</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">d</span><span class="mi">1</span><span class="p">]</span>
<span class="w"> </span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nts</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="p">[</span><span class="s2">&quot;https&quot;</span><span class="p">]</span>
<span class="w"> </span><span class="err">backe</span><span class="kc">n</span><span class="err">d</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;backend1&quot;</span>
<span class="w"> </span><span class="err">passHos</span><span class="kc">t</span><span class="err">Header</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">[</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">ds.</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">d</span><span class="mf">1.</span><span class="err">rou</span><span class="kc">tes</span><span class="p">]</span>
<span class="w"> </span><span class="p">[</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">ds.</span><span class="kc">fr</span><span class="err">o</span><span class="kc">nten</span><span class="err">d</span><span class="mf">1.</span><span class="err">rou</span><span class="kc">tes</span><span class="err">.mai</span><span class="kc">n</span><span class="p">]</span>
<span class="w"> </span><span class="err">rule</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;Host:myserver.domain.com,localhost&quot;</span>
<span class="p">[</span><span class="err">api</span><span class="p">]</span>
<span class="w"> </span><span class="err">e</span><span class="kc">ntr</span><span class="err">yPoi</span><span class="kc">nt</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="s2">&quot;traefik&quot;</span>
<span class="w"> </span><span class="err">dashboard</span><span class="w"> </span><span class="err">=</span><span class="w"> </span><span class="kc">true</span>
</code></pre></div>
<p>The enterPoints section shows we have two entry points, port 80 will be redirected to port 443. Traefik will perform this redirection so MeshCentral will never see port 80 connections. Port 443 will be setup using the given TLS certificates. In this example, we just used the certificate files generated by MeshCentral in the “meshcentral-data” folder. You can use the two certificate files as-is.</p>
<p>The backends section configures one MeshCentral server on port “4430”. Traefik will additionally check the health of the MeshCentral server periodically, every 30 seconds.</p>
<p>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”.</p>
<p>Finally, the API section creates a web portal on port 8080 for monitoring of Traefik.</p>
<h2 id="haproxy-reverse-proxy-setup">HAProxy Reverse-Proxy Setup<a class="headerlink" href="#haproxy-reverse-proxy-setup" title="Permanent link">&para;</a></h2>
<p>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: <a href="https://www.haproxy.org/">https://www.haproxy.org/</a></p>
<p><img alt="" src="images/2022-05-19-00-34-54.png" /></p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-35-32.png" /></p>
<p>In the following configuration file, we have browser connections on port 80 being redirected to HTTPS port 443. We also have Lets Encrypt cert bot for getting a real TLS certificate and “mesh.sample.com” being redirected to 127.0.0.1:444.</p>
<div class="highlight"><pre><span></span><code>global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http-server-close
frontend http
bind *:80
redirect scheme https code 301 if !{ ssl_fc }
frontend https
bind *:443 ssl crt /etc/haproxy/cert.pem
http-request add-header X-Forwarded-Proto https
acl acmepath path_beg /.well-known/acme-challenge/
acl meshcentralhost hdr(host) -i mesh.sample.com
acl meshcentralhost hdr(host) -i mesh.sample.com:443
use_backend acme if acmepath
use_backend meshcentral if meshcentralhost
backend acme
server certbot localhost:54321
backend meshcentral
http-request add-header X-Forwarded-Host %[req.hdr(Host)]
server meshcentral 127.0.0.1:444
</code></pre></div>
<p>On the MeshCentral side, we are not going to use port 80 and need the main HTTPS port to not perform TLS and listen on port 444.</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myservername.domain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">444</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AliasPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;TlsOffload&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;certUrl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://127.0.0.1:443/&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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.</p>
<h2 id="running-in-a-production-environment">Running in a Production Environment<a class="headerlink" href="#running-in-a-production-environment" title="Permanent link">&para;</a></h2>
<p>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:</p>
<div class="highlight"><pre><span></span><code>export NODE_ENV=production
</code></pre></div>
<p>On Windows, its done like this:</p>
<div class="highlight"><pre><span></span><code>SET NODE_ENV=production
</code></pre></div>
<p>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:</p>
<div class="highlight"><pre><span></span><code>MeshCentral HTTP redirection web server running on port 80.
MeshCentral v0.2.2-u, Hybrid (LAN + WAN) mode, Production mode.
MeshCentral Intel(R) AMT server running on devbox.mesh.meshcentral.com:4433.
MeshCentral HTTPS web server running on devbox.mesh.meshcentral.com:443.
</code></pre></div>
<p>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.</p>
<h2 id="two-step-authentication">Two step authentication<a class="headerlink" href="#two-step-authentication" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-38-11.png" /></p>
<p>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 users email could still log into the web site. Users should make sure to properly protect their email account.</p>
<p>Another form of MFA or Multi-factor Authentication is hardware based OTP (One Time Password) solution providing 2FA or Two-factor authentication. Yubikey is fully supported in MeshCentral.</p>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/FvDHlcdNepQ" frameborder="0" allowfullscreen></iframe>
</div>
<p>And taking authentication to the next step is removing the login page entirely. Use LoginKey 3FA with MeshCentral.</p>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/-WKY8Wy0Huk" frameborder="0" allowfullscreen></iframe>
</div>
<h2 id="server-backup-restore">Server Backup &amp; Restore<a class="headerlink" href="#server-backup-restore" title="Permanent link">&para;</a></h2>
<p>Its 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.</p>
<div class="highlight"><pre><span></span><code>meshcentral-data
meshcentral-files
</code></pre></div>
<p>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.</p>
<div class="highlight"><pre><span></span><code>mongodump --archive=backup.archive
</code></pre></div>
<p>Then, keep the backup.archive file in a safe place. Its 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.</p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>use meshcentral
db.dropDatabase()
</code></pre></div>
<p>Then exit with Ctrl-C and run:</p>
<div class="highlight"><pre><span></span><code>mongorestore --archive=backup.archive
</code></pre></div>
<p>This will re-import the database from the backup. You can then start MeshCentral again.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>The two values for <code>backup</code> and <code>restore</code> in the json are only valid for databases backed by NeDB</p>
</div>
<h3 id="backup-to-google-drive">Backup to Google Drive<a class="headerlink" href="#backup-to-google-drive" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>sudo<span class="w"> </span>systemctl<span class="w"> </span>stop<span class="w"> </span>meshcentral.service
nano<span class="w"> </span>/opt/meshcentral/meshcentral-data/config.json
</code></pre></div>
<p>Remove underscored items</p>
<p><img alt="" src="images/2022-06-17-15-56-14.png" /></p>
<div class="highlight"><pre><span></span><code>sudo<span class="w"> </span>systemctl<span class="w"> </span>start<span class="w"> </span>meshcentral.service
sudo<span class="w"> </span>systemctl<span class="w"> </span>status<span class="w"> </span>meshcentral.service
</code></pre></div>
<p>Log into your MC:</p>
<p><img alt="" src="images/2022-06-17-15-56-55.png" /></p>
<p><img alt="" src="images/2022-06-17-15-57-03.png" /></p>
<p>Create desktop app</p>
<p><img alt="" src="images/2022-06-17-15-57-15.png" /></p>
<p>Enter the Client ID and Client Secret into MC</p>
<p><img alt="" src="images/2022-06-17-15-57-30.png" /></p>
<p><img alt="" src="images/2022-06-17-15-57-52.png" /></p>
<h2 id="hashicorp-vault-support">HashiCorp Vault support<a class="headerlink" href="#hashicorp-vault-support" title="Permanent link">&para;</a></h2>
<p>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/</p>
<p>Once you got a MeshCentral server working correctly, you can start a simple demonstration Vault server by typing:</p>
<div class="highlight"><pre><span></span><code>vault server -dev
</code></pre></div>
<p>When you run the server in developer mode, you will see a secret token and unseal key on the screen. These two values will be used in the commands to follow. You can load the configuration file and all certificates from “meshcentral-data” into Vault by typing this:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --vaultpushconfigfiles --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
</code></pre></div>
<p>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”:</p>
<p><img alt="" src="images/2022-05-19-00-42-49.png" /></p>
<p>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:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
</code></pre></div>
<p>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:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;vault&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;endpoint&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;http://127.0.0.1:8200&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;token&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;s.cO4Q…&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;unsealkey&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;7g4wFC…&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;meshcentral&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>Once the config.json file is setup, you can just run MeshCentral without any arguments.</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral
</code></pre></div>
<p>Lastly you can all pull all of the files out of Vault using this command line:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --vaultpullconfigfiles --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
</code></pre></div>
<p>And delete the Vault secrets using this:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --vaultdeleteconfigfiles --vault http://127.0.0.1:8200 --token s.cO4… --unsealkey 7g4w… --name meshcentral
</code></pre></div>
<h2 id="database-record-encryption">Database Record Encryption<a class="headerlink" href="#database-record-encryption" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-44-03.png" /></p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-44-25.png" /></p>
<p>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:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4430</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">800</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;DbRecordsEncryptKey&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyReallySecretPassword&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --recordencryptionrecode
</code></pre></div>
<p>This command will re-write entries in the database that could require added security and force the application of record encryption. You can also specify a key for decryption only like this:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4430</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">800</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;DbRecordsDecryptKey&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyReallySecretPassword&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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:</p>
<div class="highlight"><pre><span></span><code>node node_modules/meshcentral --recordencryptionrecode
</code></pre></div>
<p>Its 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.</p>
<p>Also note that database record encryption can and should be used along with other data protection systems.</p>
<h2 id="mongodb-free-server-monitoring">MongoDB free server monitoring<a class="headerlink" href="#mongodb-free-server-monitoring" title="Permanent link">&para;</a></h2>
<p>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:</p>
<p><img alt="" src="images/2022-05-19-00-45-31.png" /></p>
<p>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:</p>
<p><img alt="" src="images/2022-05-19-00-45-45.png" /></p>
<p>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.</p>
<h2 id="meshcentral-single-sign-on-sso">MeshCentral Single Sign-On (SSO)<a class="headerlink" href="#meshcentral-single-sign-on-sso" title="Permanent link">&para;</a></h2>
<p>As with any web application deployed in organization, its 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.</p>
<p>Before you get started, your MeshCentral server must be publicly facing on the internet and have a valid TLS certificate. For example, by setting up Lets Encrypt. After the web site is working correctly user the steps below.</p>
<h3 id="ldap">LDAP<a class="headerlink" href="#ldap" title="Permanent link">&para;</a></h3>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/UQMbNQk85g8" frameborder="0" allowfullscreen></iframe>
</div>
<p>You can integrate LDAP using <a href="https://github.com/Ylianst/MeshCentral/blob/f05eb9a198bed249c2b1a969ce17a41404ef70a6/meshcentral-config-schema.json#L505-L513">these</a> configuration options</p>
<p><img alt="" src="images/ldap_integration.png" /></p>
<h3 id="twitter-authentication">Twitter Authentication<a class="headerlink" href="#twitter-authentication" title="Permanent link">&para;</a></h3>
<p>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 <a href="https://developer.twitter.com/en/apps">https://developer.twitter.com/en/apps</a>, this is where you can create new applications that are compatible with Twitter.</p>
<p>Start by creating a new application and fill in the application form. Give your application and name, description, server URL and more.</p>
<p><img alt="" src="images/2022-05-19-00-48-17.png" /></p>
<p>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:</p>
<p><img alt="" src="images/2022-05-19-00-48-41.png" /></p>
<p>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”.</p>
<p><img alt="" src="images/2022-05-19-00-48-54.png" /></p>
<p>Once done, your config.json should look a bit like this:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.mydomain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;twitter&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-49-25.png" /></p>
<h3 id="google-github-reddit-authentication">Google, GitHub, Reddit Authentication<a class="headerlink" href="#google-github-reddit-authentication" title="Permanent link">&para;</a></h3>
<p>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.</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.mydomain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;twitter&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-twitter-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx &quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;google&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-google-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;github&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-github-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;reddit&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-reddit-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot; xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx &quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>Its possible to enable all four of these service providers at the same time to offer the most flexibility for users. Note that when using an OAuth service provider, MeshCentral does not offer two-factor authentication since it will be handled by the provider depending on user configuration.</p>
<h3 id="microsoft-azure-active-directory">Microsoft Azure Active Directory<a class="headerlink" href="#microsoft-azure-active-directory" title="Permanent link">&para;</a></h3>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-50-18.png" /></p>
<p><img alt="" src="images/2022-05-19-00-50-30.png" /></p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-50-52.png" /></p>
<p>Next, we need to create a secret that will be shared between Azure and MeshCentral. Go to the “Certificates &amp; secrets” section and click “New client secret”. You then enter a name and for our example, we will opt to never make it expire.</p>
<p><img alt="" src="images/2022-05-19-00-51-14.png" /></p>
<p><img alt="" src="images/2022-05-19-00-51-29.png" /></p>
<p>We then copy the resulting secret and this will be the 3<sup>rd</sup> 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:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.mydomain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;azure&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;newAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;be4aadd3-77b8-4e55-af8a-4b8e2d994cb5&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;NP0XXXXXXXXXXXXXXXXXXX&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;tenantid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;18910a48-e492-4c49-8043-3449f7964bd6&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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 its 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.</p>
<p><img alt="" src="images/2022-05-19-00-52-05.png" /></p>
<h3 id="jumpcloud-authentication-using-saml">JumpCloud Authentication using SAML<a class="headerlink" href="#jumpcloud-authentication-using-saml" title="Permanent link">&para;</a></h3>
<p>While using OAuth may be interesting, its more likely that MeshCentral servers used in an enterprise environment will want to use SAML (Security Assertion Markup Language). This is a widely deployed sign-on protocol used in enterprises so that, for example, employees can login to many different web sites using a single set of company credentials. MeshCentral can be one of many web sites that some users may want to log into.</p>
<p>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.</p>
<p>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 Lets Encrypt to get a valid TLS certificate. Then, start by going to <a href="https://jumpcloud.com">https://jumpcloud.com</a> and creating an administrator account. Once setup, go to “Applications” and click on the big plug sign to create a new application.</p>
<p><img alt="" src="images/2022-05-19-00-52-36.png" /></p>
<p>You will need to create a custom SAML application by clicking the “Custom SAML App”.</p>
<p><img alt="" src="images/2022-05-19-00-52-53.png" /></p>
<p>Then, you can fill in the form with an application name and logo.</p>
<ul>
<li>For the IdP Entity ID, put “jumpcloud”.</li>
<li>For the SP Entity ID put “meshcentral”.</li>
<li>For the ACS URL, put the callback URL of your server. In this case it will be “https://(yourservername)/auth-jumpcloud-callback”</li>
<li>Lastly in the attributes section, add 3 user attribute mapping.<ul>
<li>“firstname” to “firstname”</li>
<li>“lastname” to “lastname”</li>
<li>“email” to “email”</li>
</ul>
</li>
</ul>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-53-38.png" /></p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-54-31.png" /></p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-54-50.png" /></p>
<p>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:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.mydomain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;jumpcloud&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-jumpcloud-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;entityid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;meshcentral&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;idpurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://sso.jumpcloud.com/saml2/saml2&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;jumpcloud-saml.pem&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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 its a new user that is authenticating thru JumpCloud.</p>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-55-29.png" /></p>
<p>Users can sign-in using the regular username and password or using JumpCloud.</p>
<h3 id="generic-saml-setup">Generic SAML setup<a class="headerlink" href="#generic-saml-setup" title="Permanent link">&para;</a></h3>
<p>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.</p>
<p>A generic SAML setup will look like this:</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.mydomain.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">80</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;saml&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;__callbackurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/auth-saml-callback&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;entityid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;meshcentral&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;idpurl&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://server/saml2&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;saml.pem&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-56-05.png" /></p>
<p>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.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>MeshCentral only supports "POST". <a href="https://github.com/Ylianst/MeshCentral/issues/4725">For example Authentik's</a> default setting is to use "Redirect" as a "Service Provider Binding".</p>
</div>
<h3 id="generic-openid-connect-setup">Generic OpenID Connect Setup<a class="headerlink" href="#generic-openid-connect-setup" title="Permanent link">&para;</a></h3>
<p>Generally, if you are using an IdP that supports OpenID Connect (OIDC), you can use a very basic configuration to get started, and if needed, add more specific or advanced configurations later. Here is what your config file will look like with a basic, generic, configuration.</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;cert&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;mesh.your.domain&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;sqlite3&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Mesh&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;.Your.Domain&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;authStrategies&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;oidc&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;issuer&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;https://sso.your.domain&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientid&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;clientsecret&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;newAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>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 <a href="openidConnectStrategy/">additional strategy documentation</a>.</p>
<blockquote>
<p>NOTE: MeshCentral will use <code>https://mesh.your.domain/auth-oidc-callback</code> as the default redirect uri.</p>
</blockquote>
<h2 id="improvements-to-meshcentral">Improvements to MeshCentral<a class="headerlink" href="#improvements-to-meshcentral" title="Permanent link">&para;</a></h2>
<p>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:</p>
<ul>
<li>Quick Installation By having MeshCentral published on NPM (www.npmjs.com) its 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.</li>
<li>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.</li>
<li>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. </li>
<li>Multi-Tenancy and Load Balancing Support MeshCentral can handle hosting many server instances at once. Each instance or “domain” has its 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.</li>
<li>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.</li>
<li>Web Application Design MeshCentral1 has 100s 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 clients web browser.</li>
<li>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.</li>
<li>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.</li>
<li>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.</li>
<li>Support for TLS Offloaders TLS offloaders are now fully supported. This means that MeshCentral can handle way more network connections and traffic significantly.</li>
<li>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. </li>
<li>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.</li>
<li>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.</li>
<li>Latest Security &amp; 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 1000s of line of code thus making the server incompatible with the current version version, making migration difficult.</li>
<li>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.</li>
<li>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.</li>
</ul>
<p>Its 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.</p>
<p><img alt="" src="images/2022-05-19-00-57-06.png" /></p>
<p>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.</p>
<h2 id="additional-resources">Additional Resources<a class="headerlink" href="#additional-resources" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p><img alt="" src="images/2022-05-19-00-57-28.png" /></p>
<h2 id="conclusion">Conclusion<a class="headerlink" href="#conclusion" title="Permanent link">&para;</a></h2>
<p>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.</p>
<h2 id="license">License<a class="headerlink" href="#license" title="Permanent link">&para;</a></h2>
<p>MeshCentral and this document are both opens source and licensed using Apache 2.0, the full license can be found at <a href="https://www.apache.org/licenses/LICENSE-2.0">https://www.apache.org/licenses/LICENSE-2.0</a>.</p>
<h2 id="annex-1-sample-configuration-file">Annex 1: Sample Configuration File<a class="headerlink" href="#annex-1-sample-configuration-file" title="Permanent link">&para;</a></h2>
<p>In this annex, we present a complete sample config.json file. You would put this file in the “meshcentral-data” folder that is created when MeshCentral is first run. The config.json is completely optional and the server will run with default values with it. All key names in this file are case insensitive.</p>
<div class="highlight"><pre><span></span><code><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;settings&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;MongoDb&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;mongodb://127.0.0.1:27017/meshcentral&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;MongoDbCol&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;meshcentral&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4430</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AliasPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">443</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;RedirPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">800</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;TlsOffload&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;MpsPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">44330</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;MpsAliasPort&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">4433</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;MpsTlsOffload&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;SessionTime&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">30</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;SessionKey&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyReallySecretPassword&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AllowLoginToken&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;AllowFraming&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;WebRTC&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;ClickOnce&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;domains&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;MyServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Servername&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;TitlePicture&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;title-sample.png&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;UserQuota&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1048576</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;MeshQuota&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">248576</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Footer&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;a href=&#39;https://twitter.com/mytwitter&#39;&gt;Twitter&lt;/a&gt;&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;PasswordRequirements&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">&quot;min&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">8</span><span class="p">,</span><span class="w"> </span><span class="nt">&quot;max&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">128</span><span class="p">,</span><span class="w"> </span><span class="nt">&quot;upper&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">&quot;lower&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">&quot;numeric&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">&quot;nonalpha&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;customer1&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;Dns&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;customer1.myserver.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Customer1&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Title2&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;TestServer&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;NewAccounts&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Auth&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;sspi&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;Footer&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;Test&quot;</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;info&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;share&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;C:\\ExtraWebSite&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;letsencrypt&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;email&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myemail@myserver.com &quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;names&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myserver.com,customer1.myserver.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;rsaKeySize&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">3072</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;production&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;peers&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;serverId&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;server1&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;servers&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;server1&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">&quot;url&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;wss://192.168.2.133:443/&quot;</span><span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;server2&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="nt">&quot;url&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;wss://192.168.1.106:443/&quot;</span><span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">}</span>
<span class="w"> </span><span class="p">},</span>
<span class="w"> </span><span class="nt">&quot;smtp&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;host&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;smtp.myserver.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;port&quot;</span><span class="p">:</span><span class="w"> </span><span class="mi">25</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;from&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;myemail@myserver.com&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;tls&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p>All these values are examples only, this config.json should just be used as an example and none of the values here are real.</p>
<h2 id="annex-2-tips-tricks">Annex 2: Tips &amp; Tricks<a class="headerlink" href="#annex-2-tips-tricks" title="Permanent link">&para;</a></h2>
<p>In this annex, we present various suggestions. These are often found by users on the GitHub community and readers are encouraged to participate. The GitHub community is at: <a href="https://github.com/Ylianst/MeshCentral/issues">https://github.com/Ylianst/MeshCentral/issues</a></p>
<h3 id="remote-terminal">Remote Terminal<a class="headerlink" href="#remote-terminal" title="Permanent link">&para;</a></h3>
<p>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:</p>
<div class="highlight"><pre><span></span><code>su -s /bin/bash myOtherUser
</code></pre></div>
<p>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:</p>
<div class="highlight"><pre><span></span><code>su -c &#39;/bin/bash -i&#39; myOtherUser
</code></pre></div>
<p>This will run bash in interactive mode and work correctly.</p>
<h4 id="ssh-and-sftp-integration-to-the-terminal">SSH and SFTP integration to the Terminal<a class="headerlink" href="#ssh-and-sftp-integration-to-the-terminal" title="Permanent link">&para;</a></h4>
<p>MeshCentral has built-in web-based integration of SSH in the "Terminal" tab and SFTP in the "Files" tab.</p>
<div class="video-wrapper">
<iframe width="320" height="180" src="https://www.youtube.com/embed/7qAbl2OuZEU" frameborder="0" allowfullscreen></iframe>
</div>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.tabs", "navigation.expand", "navigation.top", "navigation.instant"], "search": "../assets/javascripts/workers/search.6ce7567c.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}}</script>
<script src="../assets/javascripts/bundle.525ec568.min.js"></script>
</body>
</html>