rustdesk / rustdesk/rustdesk-server

Key mismatch when hbbs process owner has read permissions to secret key

Open
#624 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
10.4k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

I had a x86_64 VPS on a cloud provider, my Rustdesk server instance was running. I had performance issues and migrated to AWS with a arm64 EC2 instance. Both with Debian, not sure about the previous one but the EC2 instance runs Debian 13.

I copied my keypair in order to maintain the connected clients. However, I started getting key mismatch error when trying to connect from one client to another, even though it connects just fine to the server with no error in the logs.

The permissions on id_ed25519 were 644 by default, owned by root. I cd'ed to /var/lib/rustdesk-server and tried running hbbs manually and got the same error. I then proceeded to set permissions as 600. Interestingly enough, if I run with my user, that can't read the secret key, I'm able to use Rustdesk and connect one client to another with no issue. However, if I run as root, key mismatch error appears again.

I tried setting the systemd service to use another user and group, which wouldn't have access to the secret key, however the process seems to keep running as root, therefore key mismatch error.

I thought it could be a systemd issue, but the fact that the error also happens when I run manually with a user that can read the secret key makes it seem unlikely. In this whole process I didn't really touch hbbr.

Logs don't show any trace of error, so I have no idea what to try next besides setting up something sketchy with crontab. Maybe that's an arm64 build issue?

Forgot to add: after setting permissions as 600, I also tried changing ownership of id_ed25519 to a regular user and running it with that same user, also got key mismatch. So everytime the user running hbbs had read access to id_ed25519 I got key mismatch.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the hbbs entry point and the systemd service configuration, then reproduce the behavior using /var/lib/rustdesk-server/id_ed25519 under users with and without read access. Review the available logs and compare the working and failing runs across the Debian x86_64 and arm64 setups. Done means identifying the cause of the key mismatch and documenting or correcting the affected server behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, rust
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.