Page 1 of 2
[SOLVED] tis-rustdesk-config-template
Published: October 7, 2024 - 4:10 PM
by smandel
Hello everyone,
I've had a Rustdesk server installed for quite some time now, and I've seen that agent deployment is now possible with a WAPT package.
Currently, I'm using it on demand with the information in the binary name.
I suspect I need to enter the server information in the "rustdesk.cfg" file within the template, but in what format?
Thank you.
Re: tis-rustdesk-config-template
Published: October 8, 2024 - 9:36 PM
by sfonteneau
I used the example from the documentation to create the cfg, here
https://github.com/techahold/rustdeskin ... ll.sh#L276
Code: Select all
hostname = '192.168.1.1'
apiurl = ''
pubkey = glob.glob('/opt/rustdesk/*.pub')[0]
key = open(pubkey,'r').read()
config = {"host":hostname,"relay":hostname,"key":key,"api":apiurl}
rustdesk_list = list(base64.b64encode(json.dumps(config,separators=(',', ':')).encode('utf-8')).decode('utf-8').replace('=',''))
rustdesk_list.reverse()
rustdesk_cfg = ''.join(rustdesk_list)
print(rustdesk_cfg)
Rustdesk accepts the cfg format like this:
Code: Select all
rustdesk.exe --config JIDEZOD79ZED?
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 9:11 AM
by smandel
I'm still having trouble understanding.
Is this the content to add to the cfg file?
Does the pubkey seem to be the server-side path?
Is the template to be executed on the server?
Thank you.
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 9:33 AM
by sfonteneau
The cfg file actually contains the server's public key, yes.
The code here is fundamentally executed on the server, yes.
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 10:33 AM
by smandel
So, this code needs to be executed server-side, which will generate the configuration ID?
Then, this ID needs to be added to the rustdesk.cfg file of the template?
To deploy the configuration to the clients?
Sorry, I'm trying to understand how it works.

Re: tis-rustdesk-config-template
Published: October 9, 2024 - 10:38 AM
by sfonteneau
To put it simply
On your own machine, in a Python script, you can run this:
Code: Select all
import base64
import json
# read from /opt/rustdesk/*.pub
key = "ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD"
hostname = '192.168.1.1'
apiurl = ''
config = {"host":hostname,"relay":hostname,"key":key,"api":apiurl}
rustdesk_list = list(base64.b64encode(json.dumps(config,separators=(',', ':')).encode('utf-8')).decode('utf-8').replace('=',''))
rustdesk_list.reverse()
rustdesk_cfg = ''.join(rustdesk_list)
print('CFG:')
print(rustdesk_cfg)
Simply replace "ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" with the content of your Rustedesk server's advertisement
and replace 192.168.1.1 with the IP address of your Rustdesk server
The print command will display the cfg
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 10:51 AM
by smandel
Yes, no problem, the CFG will display.
But in the template, it shows that it's reading the rustdesk.cfg file.
What should be put in this rustdesk.cfg file?
The code output?
Thank you.
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 10:54 AM
by sfonteneau
Launch the update_package command (from the console).
The GUI will ask you for the cfg file.

Re: tis-rustdesk-config-template
Published: October 9, 2024 - 11:11 AM
by smandel
Ah yes, OK!
Perfect.

However, we see that the password is transmitted in encrypted form in the audit data.
Where can we find it in plain text in the console?
Thank you.
Re: tis-rustdesk-config-template
Published: October 9, 2024 - 1:28 PM
by sfonteneau
smandel wrote: ↑Oct 9, 2024 - 11:11
Where can we find it in plain text in the console?
On the machine's audit data tab, check the "decrypt data" box.