Service to launch TeamViewer Remote Desktop
You can install from source with:
$ git clone https://github.com/RDCH106/teamviewer-service.git --recursive
$ cd teamviewer-service
$ pip install -r requirements.txt
Execute TeamViewer service with:
$ cd teamviewer-service/teamviewerservice
$ python gateway_main.py
In the first execution default config.json will be created in the working directory:
Error loading config.json!
Default config.json generated! Try again.
👁️Check Configure tv_config.jon
👁️Check Change Linkero adminSecret
Running again the service will start to work:
$ python gateway_main.py
Create tv_config.jon
file in config
with this content:
{"tv_path": "C:/path/to/teamviewer/TeamViewer.exe"}
where tv_path
is the path to TeamViewer excutable. You can use TiemViewer portable version without installation for this purpose.
Change Linkero adminSecret typing the followings command:
python -c 'from linkero.tools.passwordHashGenerator import generatePasswordHash; generatePasswordHash()'
Introduce desired password and push enter. The password hash will be print in the following line in blue color. Copy the password hash to config.json
in config
folder. Search default adminSecret:
$5$rounds=549561$kWqFvPNTcBsl.Kle$ONikf.BJtqKKFTZbUtVmwZn0nDdwrsHhjyqgxRlUNw4
And replace it by your generated password hash.
Execute the following python code with gateway_main.py
running:
from requests import post
post ('http://localhost:5000/api/users', data={"username":"myuser","password":"mypassword","secret":"myadminSecret"})
where "http://localhost:5000/api/users" is the local endpoint, "myuser" is the username for the new user, "mypassword" is the password for the new user and "myadminSecret" is the adminSecret introduced in Change Linkero adminSecret section.
If everything is correct, the post will return <Response [201]
where code 201
indicates the correct creation of the user.
startTV
: Launch TeamViewer (login is required)- Example: http://localhost:5000/startTV
- Return: "OK" if TeamViewer is launched
- Example: http://localhost:5000/startTV
screenshot
: Take screenshot (where user ID and password appear) and return it (login is required)- Example: http://localhost:5000/screenshot
- Return: Screenshot image
- Example: http://localhost:5000/screenshot
logout
: Close user session- Example: http://localhost:5000/logout
- Return: "Logout" with 401 code
- Example: http://localhost:5000/logout