The top answer may have been accurate before, but I'm guessing Ubuntu has made changes for Kubuntu or Kubuntu just runs differently.
I honestly find it a little annoying that Ubuntu keeps trying to take away or hide this option like any user who is insane enough to do this is not aware of the risks.
That being said, the directory /etc/kde4/kdm/kdmrc/
doesn't exist on Kubuntu 21.10.
So, I found a work around in frustration.
The first steps to set root
password remain the same, obviously.
Using command, sudo passwd root
to set a new root password.
It's advisable to set a root
password that's different from your user password and hard to guess for obvious reasons.
Preview of me setting a root
user password:

Then run sudo usermod -U root
to activate the root
account
Now here's the major difference in Kubuntu. The directory /etc/kde4/
or any /etc/kde.../
does not exist in Kubuntu. /etc/pam.d/
exists, but the file you'll be editing is named sddm
, not gdm-password
There's no such thing as /etc/kde/... :

You'll be editing one or both of the files under /etc/sddm/
. Their contents are the same and so is the edit.
Preview of the contents in /etc/sddm/
directory:

- The file
./wayland-session
(To enable root login if you're logging in with Wayland session in the Desktop Environment)
- The file
./Xsession
(To enable root login if you're logging in with Xsession in the Desktop environment. This is usually the default when you install Kubuntu and most likely what you're using).
- Or you can edit both files.
Using the Terminal/console, navigate to /etc/sddm/
and open one of the files (I'll be using Xsession) by running sudo nano Xsession
(Alternatively, you can just run sudo nano /etc/sddm/Xsession
from any terminal screen).
Preview of the nano file editor commands and navigation commands:

The file opens. Using the arrow keys, carefully navigate to near the end of the text context (like the last 3 or 4 lines) just under;
esac
Add the following text as one line and save the file/changes (using ^X
[i.e. CtrlX] and saying 'Yes/Y').
AllowRoot=true
Preview of the file ./Xsession after editing:

The steps are the same if you chose to edit the file ./wayland-session
instead.
The last step is to navigate to directory /etc/pam.d/
in the Tterminal and opening the file ./sddm
using the command: sudo nano sddm
(Or just run command the single command sudo nano /etc/pam.d/sddm
)
Preview of contents in the directory /etc/pam.d/ showing ./sddm:

In the opened file (./sddm), near the top (like the first 3 lines or so) we'll add the "#" symbol in front of the line:
auth required pam_succeed_if.so user != root quiet_success
This turns it into a comment so the computer ignores that line, so it becomes:
#auth required pam_succeed_if.so user != root quiet_success
Again close/save the file (with ^X
/CtrlX).
file ./sddm before edit:

file ./sddm after edit:

Now go back to the lockscreen (log out or switch user) and log in as root.
You may have to manually type "root" as username and use the root password you set earlier.
Now you're root.
When you're done, it's highly recommended to undo the file changes you made and deactivate root user password by running sudo passwd -dl root
.