How to configure KRDP via command line

Hello everyone,

I’d like to use KRDP for remote connections on a KDE desktop device, but I’m encountering two issues:

  1. My desktop is configured with auto-login, and it seems KRDP fails to initialize properly in this scenario. I have to manually disable and then re-enable KRDP in the settings to make it work.
  2. Occasionally, there’s a graphical confirmation dialog required to authorize connections.

Since I can access the device via SSH, I’m wondering if there are ways to:

  1. Restart KRDP service through command line
  2. Implement a command-line agent that can intercept such connection requests and provide confirmation directly in the terminal

Any guidance would be appreciated!

Regarding point 1: I’ve discovered a workaround by adding this script to the autostart:

#!/bin/sh

sleep 30
systemctl restart --user app-org.kde.krdpserver.service

For point 2: I haven’t found any viable method to achieve this yet.

Regarding point 2: I’ve discovered that KRDP maintains persistent configurations which survive reboots without requiring re-confirmation. The previous issue was likely caused by me manually disabling and re-enabling KRDP in the settings, which consequently reset its persistent configuration.