Login security

MeshCentral Login – Accounts, Two-Factor Authentication and Recovery

The login page guards every device on the server. Here is how to make it strong without making it awkward.

MeshCentral welcome and login page with username and password fields

MeshCentral login security deserves more attention than almost any other part of a deployment, because the login page is the front door to every computer the server manages. Anyone who signs in with administrator rights can view desktops, run commands and move files across the whole fleet. This article explains how the MeshCentral login works, how the first account is created, which authentication options are available, how to enforce strong passwords and two-factor authentication, how single sign-on fits in and what to do when someone is genuinely locked out.

How the Login Page Works

When you browse to a MeshCentral server, the default domain presents a login page with fields for a user name and password, and, if registration is permitted, a link to create an account. After a successful sign-in, the server issues a session and opens the dashboard. Every subsequent action, whether listing devices or opening a remote desktop, is checked against that account's permissions.

Behind the scenes, the browser holds a session cookie and communicates with the server over an encrypted WebSocket connection. That is why a trusted TLS certificate matters for the login page: without it, users grow used to clicking through browser warnings, which is exactly the habit an attacker would exploit.

The First Account Becomes the Administrator

On a brand-new server, the first account created is automatically made a full site administrator. This is convenient, but it also creates a short window of risk: if a fresh server is reachable from the internet before you create your own account, someone else could register first.

The safe sequence is straightforward:

  • install and start the server, ideally while it is reachable only from your own network;
  • create your administrator account immediately;
  • set newAccounts to false in config.json so that the registration link disappears;
  • only then expose the server to the internet.

Additional accounts can then be created by the administrator from the My Users area, with exactly the rights each person needs.

Choosing How Users Authenticate

MeshCentral supports several authentication approaches, which can suit very different organisations.

Local accounts

The simplest option stores accounts in the server's own database. Passwords are hashed rather than stored in plain text. For a home lab or a small team, local accounts with two-factor authentication are entirely adequate.

LDAP and Active Directory

Organisations that already maintain accounts in Active Directory or another LDAP directory can configure MeshCentral to check credentials against it. This keeps passwords in one place and means that disabling a user in the directory also stops them signing in to MeshCentral.

Single sign-on

MeshCentral can delegate authentication to external identity providers through standards such as OpenID Connect, and the documentation covers integrations with common providers as well as Active Directory Federation Services. With single sign-on, the organisation's existing policies, including conditional access and its own multi-factor requirements, apply to MeshCentral automatically.

Enforcing Strong Passwords

For local accounts, the domain section of config.json can define password requirements. A typical policy sets a minimum length and requires a mix of character types:

"passwordRequirements": {
  "min": 12,
  "max": 128,
  "upper": 1,
  "lower": 1,
  "numeric": 1,
  "nonalpha": 1,
  "force2factor": true
}

The force2factor option is especially valuable: it requires every user to set up a second factor before they can use the server. Length matters far more than complexity, so a long passphrase is better than a short password full of symbols.

Two-Factor Authentication Options

A second factor ensures that a stolen password is not enough on its own. MeshCentral offers several methods, which users configure from their account settings.

  • Authenticator apps. Time-based one-time codes from apps such as those offered by Microsoft, Google or open-source alternatives.
  • Hardware security keys. FIDO2 and WebAuthn keys provide strong protection against phishing because the key checks the website's identity before responding.
  • Backup codes. A set of single-use codes for emergencies, which should be printed or stored securely offline.
  • Email or SMS codes. Available when the server has been configured with an email or messaging service, though these are weaker than authenticator apps or hardware keys.

Encourage administrators in particular to use hardware keys or authenticator apps and to keep backup codes somewhere safe.

Every administrator account should have at least two independent ways to pass the second factor, so that a lost phone does not become a lockout.

Protecting Against Password Guessing

Login pages on the internet are scanned and attacked constantly. MeshCentral can limit repeated failed attempts from the same address using the maxInvalidLogin setting, which temporarily blocks further attempts after too many failures within a set period. Combined with long passwords and two-factor authentication, this makes automated guessing impractical.

Further protection comes from restricting who can reach the login page at all. The userAllowedIP setting limits browser access to specified addresses or ranges, which is ideal when administrators always connect from an office network or a VPN. A separate setting controls which addresses agents may connect from, so device connectivity is unaffected.

Session Timeouts and Sign-Out

An unattended browser with an open MeshCentral session is a risk, particularly on shared computers. The userSessionIdleTimeout setting signs users out after a period of inactivity. Users should also sign out explicitly when they finish, and administrators should avoid signing in from computers they do not control.

Login Tokens for Tools

Some companion tools, such as MeshCentral Router and the MeshCtrl command-line utility, need to sign in to the server. Rather than embedding your main password in scripts or shortcuts, MeshCentral lets each user create login tokens: separate credentials with an optional expiry that can be revoked independently. If a token is exposed, delete it without changing your main password. Note that MeshCentral Router does not support hardware WebAuthn keys, though it does support one-time password devices, so plan second factors with that in mind.

Recovering a Locked-Out Account

People forget passwords and lose phones. The right recovery method depends on the situation.

  • A user who forgets a password can be given a new one by an administrator from the My Users area. If the server has email configured, users can also reset their own passwords through a link.
  • A user who loses their second factor can use a backup code, or an administrator can remove their two-factor settings after verifying their identity through another channel.
  • The only administrator who is locked out needs access to the server itself. MeshCentral includes command-line options that run on the server machine to reset an account's password or grant administrator rights.
node node_modules/meshcentral --resetaccount adminname --pass NewLongPassphrase

Because these options require shell access to the server and its data folder, they do not weaken the login page itself. Stop the service before running them and start it again afterwards.

Auditing Sign-In Activity

MeshCentral records events, including sign-ins and administrative actions, which administrators can review from the dashboard. Look periodically for sign-ins at unusual times, from unfamiliar addresses or for accounts that should be dormant. An authentication log can also be written to a file for integration with an organisation's monitoring tools, so that failed attempts trigger alerts.

Recognising Phishing Attempts

Because MeshCentral pages have a recognisable appearance, attackers sometimes imitate them. Teach users to check the address bar before entering credentials, to be suspicious of unexpected emails asking them to sign in, and never to share codes from their authenticator app. Hardware security keys provide built-in protection here, because they refuse to authenticate to a look-alike domain.

A Sensible Login Policy for Different Sizes of Team

The right policy depends on who uses the server, but a few patterns work well.

A home lab or single administrator

One administrator account protected by a long passphrase and a hardware key or authenticator app, with backup codes stored offline, is usually sufficient. Restricting the login page to your home network or a VPN adds a strong extra layer at almost no cost.

A small business

Create a named account for every technician rather than sharing one login, so that the event log shows who did what. Require two-factor authentication for everyone, set an idle timeout and review the user list whenever someone leaves.

A larger organisation or service provider

Connect MeshCentral to the organisation's directory or identity provider, so that joiners, movers and leavers are handled centrally. Combine single sign-on with conditional access rules, keep a small number of local break-glass administrator accounts for emergencies and audit sign-in events regularly.

Whatever the size, avoid shared accounts. They make it impossible to tell who performed an action and very difficult to remove one person's access without disrupting everyone else.

Signing In from Shared or Untrusted Computers

Administrators occasionally need to sign in from a computer that is not their own. Where possible, avoid it: a compromised machine can capture passwords and session cookies regardless of how strong the server's defences are. If it cannot be avoided, use a private browsing window, rely on a hardware security key rather than typing codes, sign out explicitly at the end and change your password afterwards if you have any doubt about the machine. Short idle timeouts reduce the damage if a session is accidentally left open.

Frequently Asked Questions

There is no default account. The first account created on a new server becomes the administrator, which is why you should create it immediately and then disable open registration.

Set newAccounts to false in the domain section of config.json and restart the server. The registration link then disappears from the login page.

Yes. Setting force2factor in the password requirements makes every user configure a second factor before they can use the server.

Yes. It can authenticate against LDAP directories, including Active Directory, and supports single sign-on through standards such as OpenID Connect.

With access to the server itself, stop the service and use the command-line option to reset your account's password, then start the service and sign in.

Configure maxInvalidLogin to block repeated failures, and use userAllowedIP to restrict which networks can reach the login page at all.

Conclusion

The MeshCentral login is where the security of the whole platform is decided. Create the administrator account before anyone else can, close open registration, require long passwords and a second factor for everyone, and limit who can even reach the login page. Use login tokens for tools instead of sharing passwords, keep backup codes safe and review sign-in events regularly. These measures take little time to put in place, yet they protect every computer the server can reach.