[GH-ISSUE #74] Global settings: meshcentral #38

Closed
opened 2026-03-02 02:13:02 +03:00 by kerem · 11 comments
Owner

Originally created by @alovaal on GitHub (Aug 26, 2020).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/74

Changing the meshcentral username leads to full meshcentral view instead of only eg. remoteconsole in iframes

Originally created by @alovaal on GitHub (Aug 26, 2020). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/74 Changing the meshcentral username leads to full meshcentral view instead of only eg. remoteconsole in iframes
kerem closed this issue 2026-03-02 02:13:02 +03:00
Author
Owner

@sadnub commented on GitHub (Aug 26, 2020):

Did you also update the user on the meshcentral side? I don't think it auto updates. We might be able to make it update the user automatically.

<!-- gh-comment-id:680908491 --> @sadnub commented on GitHub (Aug 26, 2020): Did you also update the user on the meshcentral side? I don't think it auto updates. We might be able to make it update the user automatically.
Author
Owner

@wh1te909 commented on GitHub (Aug 26, 2020):

Correct, it does not auto update. It's only there in case your meshcentral installation gets corrupted or whatever and you have to reinstall mesh and then update the settings. Otherwise, you shouldn't touch any of the meshcentral settings, it's just used to generate a login token key which is part of the iframe, and it only needs 1 meshcentral user to do that. So if you add more users to your RMM, you don't need to add more mesh users.

If you really want to change the mesh username in Global Settings then you'll need to create it in meshcentral first.

<!-- gh-comment-id:680988134 --> @wh1te909 commented on GitHub (Aug 26, 2020): Correct, it does not auto update. It's only there in case your meshcentral installation gets corrupted or whatever and you have to reinstall mesh and then update the settings. Otherwise, you shouldn't touch any of the meshcentral settings, it's just used to generate a login token key which is part of the iframe, and it only needs 1 meshcentral user to do that. So if you add more users to your RMM, you don't need to add more mesh users. If you really want to change the mesh username in Global Settings then you'll need to create it in meshcentral first.
Author
Owner

@alovaal commented on GitHub (Aug 26, 2020):

Hello, did not expect it to rename the user so I created it with same rights as previously.

<!-- gh-comment-id:681035365 --> @alovaal commented on GitHub (Aug 26, 2020): Hello, did not expect it to rename the user so I created it with same rights as previously.
Author
Owner

@wh1te909 commented on GitHub (Aug 26, 2020):

so here is how the original account is created during install, just a full admin maybe try it from command line?

sudo systemctl stop meshcentral
cd /meshcentral
node node_modules/meshcentral --createaccount <username> --pass <password> --email <you@example.com>
node node_modules/meshcentral --adminaccount <username>
sudo systemctl start meshcentral
<!-- gh-comment-id:681037074 --> @wh1te909 commented on GitHub (Aug 26, 2020): so here is how the original account is created during install, just a full admin maybe try it from command line? ``` sudo systemctl stop meshcentral cd /meshcentral node node_modules/meshcentral --createaccount <username> --pass <password> --email <you@example.com> node node_modules/meshcentral --adminaccount <username> sudo systemctl start meshcentral ```
Author
Owner

@wh1te909 commented on GitHub (Aug 26, 2020):

ok just tested it looks like you also have to add the new user to the device group in meshcentral, thought it would add by default if it was an admin account

From meshcentral website, 2nd tab "My Account" find the device group named TacticalRMM then click Add Users and add your newly created username.

<!-- gh-comment-id:681050059 --> @wh1te909 commented on GitHub (Aug 26, 2020): ok just tested it looks like you also have to add the new user to the device group in meshcentral, thought it would add by default if it was an admin account From meshcentral website, 2nd tab "My Account" find the device group named TacticalRMM then click Add Users and add your newly created username.
Author
Owner

@alovaal commented on GitHub (Aug 26, 2020):

Did add to group,
I probably was a bit unclear.
Login is successfull but the view is not "stripped" as with the initial user

Hanki Outlook for Androidhttps://aka.ms/ghei36


From: wh1te909 notifications@github.com
Sent: Wednesday, August 26, 2020 9:31:13 PM
To: wh1te909/tacticalrmm tacticalrmm@noreply.github.com
Cc: Mika Laavola mika@laavola.fi; Author author@noreply.github.com
Subject: Re: [wh1te909/tacticalrmm] Global settings: meshcentral (#74)

ok just tested it looks like you also have to add the new user to the device group in meshcentral, thought it would add by default if it was an admin account

From meshcentral website, 2nd tab "My Account" find the device group named TacticalRMM then click Add Users and add your newly created username.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/wh1te909/tacticalrmm/issues/74#issuecomment-681050059, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG7EWL5FJWS3R7MY5542KSLSCVIHDANCNFSM4QLU5HCQ.

<!-- gh-comment-id:681052475 --> @alovaal commented on GitHub (Aug 26, 2020): Did add to group, I probably was a bit unclear. Login is successfull but the view is not "stripped" as with the initial user Hanki Outlook for Android<https://aka.ms/ghei36> ________________________________ From: wh1te909 <notifications@github.com> Sent: Wednesday, August 26, 2020 9:31:13 PM To: wh1te909/tacticalrmm <tacticalrmm@noreply.github.com> Cc: Mika Laavola <mika@laavola.fi>; Author <author@noreply.github.com> Subject: Re: [wh1te909/tacticalrmm] Global settings: meshcentral (#74) ok just tested it looks like you also have to add the new user to the device group in meshcentral, thought it would add by default if it was an admin account From meshcentral website, 2nd tab "My Account" find the device group named TacticalRMM then click Add Users and add your newly created username. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<https://github.com/wh1te909/tacticalrmm/issues/74#issuecomment-681050059>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AG7EWL5FJWS3R7MY5542KSLSCVIHDANCNFSM4QLU5HCQ>.
Author
Owner

@wh1te909 commented on GitHub (Aug 26, 2020):

hmm im not able to reproduce. I created a brand new user from meshcentral, added to the TacticalRMM device group and set it to "Full Administrator" for the permissions. Then from the RMM Global Settings I just changed the username and all working, it's rendering the iframe stripped.

Could be the mesh nodeid changed, can you right click on the agent then do Agent Recovery and choose the Mesh central recovery. Assuming the agent is online and checking it, give it a few minutes and try again. That recovery will check the agent's current mesh ID and compare it with what's in the database and update it if they don't match.

You can also check manually, right click on the agent and do a "Send Command" (cmd) and send it

"C:\Program Files\Mesh Agent\meshagent.exe" -nodeidhex

Then login to the Django admin portal (was one of the links provided at the end of the install script), same login info you use for the RMM. Then Under Agents click Agents, then click on your Agent and scroll down and check the "Mesh node id" field and compare that ID with the output of the send command ID to see if they're the same.

<!-- gh-comment-id:681141415 --> @wh1te909 commented on GitHub (Aug 26, 2020): hmm im not able to reproduce. I created a brand new user from meshcentral, added to the TacticalRMM device group and set it to "Full Administrator" for the permissions. Then from the RMM Global Settings I just changed the username and all working, it's rendering the iframe stripped. Could be the mesh nodeid changed, can you right click on the agent then do Agent Recovery and choose the Mesh central recovery. Assuming the agent is online and checking it, give it a few minutes and try again. That recovery will check the agent's current mesh ID and compare it with what's in the database and update it if they don't match. You can also check manually, right click on the agent and do a "Send Command" (cmd) and send it ``` "C:\Program Files\Mesh Agent\meshagent.exe" -nodeidhex ``` Then login to the Django admin portal (was one of the links provided at the end of the install script), same login info you use for the RMM. Then Under Agents click Agents, then click on your Agent and scroll down and check the "Mesh node id" field and compare that ID with the output of the send command ID to see if they're the same.
Author
Owner

@dan578 commented on GitHub (Aug 28, 2020):

Having the same issue here. Creating a new user giving admin rights adding to tacticalRMM and updating the global settings i still get the full mesh central ui rather than just the remote frame.

<!-- gh-comment-id:682475344 --> @dan578 commented on GitHub (Aug 28, 2020): Having the same issue here. Creating a new user giving admin rights adding to tacticalRMM and updating the global settings i still get the full mesh central ui rather than just the remote frame.
Author
Owner

@wh1te909 commented on GitHub (Aug 28, 2020):

Ok still not able to reproduce. As a test, I just spun up a fresh server and did a fresh install and installed an agent.
Then logged into meshcentral site directly with the original account.
"My Users" tab > New Account... then created a new user "john"
Then clicked on the new user
Clicked "Add Device Group"
Device Group: TacticalRMM
checked "Full Administrator"

should look like this:

meshjohn

From Global Settings then in RMM I changed the username to "john" and saved.

meshjohn1

Then right click on agent, take control and remote background.
Iframes rendered correctly.

Can you guys please try the following to help debug

Edit this file /rmm/api/tacticalrmm/agents/views.py
Look for the following code and add the following 3 lines (see full code snippet below for where to add the lines)

logger.warning(control)  ### ADD THIS LINE
logger.warning(terminal) ### ADD THIS LINE
logger.warning(file) ### ADD THIS LINE

Then restart the rmm service sudo systemctl restart rmm
Now everytime you click "take control" or "remote background", check in the debug log from the web gui (File > Debug Log) and go to the warning tab and you will see the full URLs that are being generated. Copy and paste those into an incognito browser window and let me know if it renders correctly.

@api_view()
def meshcentral(request, pk):
    agent = get_object_or_404(Agent, pk=pk)
    core = CoreSettings.objects.first()

    token = agent.get_login_token(
        key=core.mesh_token, user=f"user//{core.mesh_username}"
    )

    if token == "err":
        return notify_error("Invalid mesh token")

    control = (
        f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=11&hide=31"
    )
    terminal = (
        f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=12&hide=31"
    )
    file = (
        f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=13&hide=31"
    )
    webrdp = f"{core.mesh_site}/mstsc.html?login={token}&node={agent.mesh_node_id}"

    logger.warning(control)  ### ADD THIS LINE
    logger.warning(terminal) ### ADD THIS LINE
    logger.warning(file) ### ADD THIS LINE

    ret = {
        "hostname": agent.hostname,
        "control": control,
        "terminal": terminal,
        "file": file,
        "webrdp": webrdp,
    }
    return Response(ret)
<!-- gh-comment-id:683125081 --> @wh1te909 commented on GitHub (Aug 28, 2020): Ok still not able to reproduce. As a test, I just spun up a fresh server and did a fresh install and installed an agent. Then logged into meshcentral site directly with the original account. "My Users" tab > New Account... then created a new user "john" Then clicked on the new user Clicked "Add Device Group" Device Group: TacticalRMM checked "Full Administrator" should look like this: ![meshjohn](https://user-images.githubusercontent.com/7434746/91610307-d1bf5980-e92d-11ea-92cd-1bff2a14fdee.PNG) From Global Settings then in RMM I changed the username to "john" and saved. ![meshjohn1](https://user-images.githubusercontent.com/7434746/91610530-4397a300-e92e-11ea-8687-673ee5ad9df9.PNG) Then right click on agent, take control and remote background. Iframes rendered correctly. Can you guys please try the following to help debug Edit this file ```/rmm/api/tacticalrmm/agents/views.py``` Look for the following code and add the following 3 lines (see full code snippet below for where to add the lines) ``` logger.warning(control) ### ADD THIS LINE logger.warning(terminal) ### ADD THIS LINE logger.warning(file) ### ADD THIS LINE ``` Then restart the rmm service ```sudo systemctl restart rmm``` Now everytime you click "take control" or "remote background", check in the debug log from the web gui (File > Debug Log) and go to the warning tab and you will see the full URLs that are being generated. Copy and paste those into an incognito browser window and let me know if it renders correctly. ``` @api_view() def meshcentral(request, pk): agent = get_object_or_404(Agent, pk=pk) core = CoreSettings.objects.first() token = agent.get_login_token( key=core.mesh_token, user=f"user//{core.mesh_username}" ) if token == "err": return notify_error("Invalid mesh token") control = ( f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=11&hide=31" ) terminal = ( f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=12&hide=31" ) file = ( f"{core.mesh_site}/?login={token}&node={agent.mesh_node_id}&viewmode=13&hide=31" ) webrdp = f"{core.mesh_site}/mstsc.html?login={token}&node={agent.mesh_node_id}" logger.warning(control) ### ADD THIS LINE logger.warning(terminal) ### ADD THIS LINE logger.warning(file) ### ADD THIS LINE ret = { "hostname": agent.hostname, "control": control, "terminal": terminal, "file": file, "webrdp": webrdp, } return Response(ret) ```
Author
Owner

@dan578 commented on GitHub (Sep 2, 2020):

@wh1te909 Back in work today so able to have a look. Done what you asked. The url does the same thing when copied opens the full mesh ui. Looking at the URL most of it is just login information and which node. It seems the end is potentially the important bit?

&viewmode=13&hide=31 (Files)
&viewmode=12&hide=31 (Terminal)
&viewmode=11&hide=31 (Remote)

<!-- gh-comment-id:685468886 --> @dan578 commented on GitHub (Sep 2, 2020): @wh1te909 Back in work today so able to have a look. Done what you asked. The url does the same thing when copied opens the full mesh ui. Looking at the URL most of it is just login information and which node. It seems the end is potentially the important bit? &viewmode=13&hide=31 (Files) &viewmode=12&hide=31 (Terminal) &viewmode=11&hide=31 (Remote)
Author
Owner

@wh1te909 commented on GitHub (Sep 2, 2020):

yea that's very strange, not sure why it is not hiding. For me the full URL opens the mesh site with everything hidden except for the correct viewmode.

I have seen this before with meshcentral back before I even made tacticalrmm, and if I recall correctly just moving the parameters around in the url seemed to fix it.

Can you try moving the &viewmode and &hide to the beginning of the full URL?
Whichever parameter you put first you'll need to change the '&' to a '?', the rest keep them '&'

So it should look something like this
mesh.yourwebsite.com/?viewmode=13&hide=31&node=MESHNODEID&login=LOGINTOKEN

I'll tag @Ylianst not sure if he will see this but maybe can correct me if I'm doing something wrong?

<!-- gh-comment-id:685883196 --> @wh1te909 commented on GitHub (Sep 2, 2020): yea that's very strange, not sure why it is not hiding. For me the full URL opens the mesh site with everything hidden except for the correct viewmode. I have seen this before with meshcentral back before I even made tacticalrmm, and if I recall correctly just moving the parameters around in the url seemed to fix it. Can you try moving the &viewmode and &hide to the beginning of the full URL? Whichever parameter you put first you'll need to change the '&' to a '?', the rest keep them '&' So it should look something like this mesh.yourwebsite.com/?viewmode=13&hide=31&node=MESHNODEID&login=LOGINTOKEN I'll tag @Ylianst not sure if he will see this but maybe can correct me if I'm doing something wrong?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#38
No description provided.