By logging out you mean actually going to power settings log out?
Because this also stops the zroc share for me and all other processes running.
Ah. Yes that's what I mean and yes that is important. You want to run zrok as a service or somehow disconnect the terminal from the session so you can logout.
You can check out zrok front door here: zrok frontdoor | Zrok. You could go search the internet for other ways to do it. You could write your own systemd service, you could use nohup, whatever you decide works best for you.
I cant find a way to log out without killing the process, how did you do that?
You can either start it as a systemd service:
You can use zrok front door (which will end up making a sysetmd service):
You can run "nohup" and put the process into the background:
It's not as "elegant" as the other two but for some it's easier to understand and manage. This for example will keep your zrok test endpoint running until the box restarts. (that's why learning systemd is probably worth it as systemd will restart it for you)...
nohup zrok test endpoint --port 8449 --address 0.0.0.0 &
I tried both of these but zrok just doesnt want to start sadly.
this is my service:
GNU nano 6.2 /etc/systemd/system/start-on-boot.service M
[Unit]
Description= trying
[Service]
ExecStart=/home/firn/logouttest.sh
Type=simple
[Install]
WantedBy=multi-user.target
this is my the script:
#!/bin/bash
zrok share private --backend-mode tcpTunnel 127.0.0.1:3389
sorry, for the question, i know this isnt exactly zrok related.
first thing i would do is reserve a share. this way your 'access' is always the same making accessing it muchmuch easier:
zrok reserve private --backend-mode tcpTunnel 127.0.0.1:3389 --unique-name cdtestrdp
After that update your script to start that reserved share. you can see I used /home/cd/start-zrok-rdp.sh
. You must pass --headless
as well and use the proper shebang (which you have)
cat /home/cd/start-zrok-rdp.sh
#!/bin/sh
/home/cd/bin/zrok share reserved cdtestrdp --headless
You also need to make sure it's executable:
sudo chmod +x /home/cd/start-zrok-rdp.sh
Make/edit the zrok-rdp
service:
sudo vi /etc/systemd/system/zrok-rdp.service
Use this content:
[Unit]
Description=Start zrok share to share RDP
After=network.target
[Service]
ExecStart=/home/cd/start-zrok-rdp.sh
Type=notify
Restart=always
Environment=HOME=/home/cd
[Install]
WantedBy=default.target
RequiredBy=network.target
Reload systemd and enable zrok rdp and verify status:
sudo systemctl daemon-reload
sudo systemctl enable zrok-rdp
sudo systemctl status zrok-rdp
Use journalctl to see the logs:
sudo journalctl -fu zrok-rdp
Hopefully that helps...
Security tip: Add --closed
to your zrok command to ensure that only your own zrok account can access the private share.
zrok reserve private --closed --backend-mode tcpTunnel 127.0.0.1:3389 --unique-name cdtestrdp