[SOLVED] Need to exclude root from logging into KDE via VNC
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need to exclude root from logging into KDE via VNC
Hopefully this is simple. I have x11vnc running as a daemon in my Slackware64 14.2 system. The desktop is KDE and the greeter is lightdm. I'd like to prevent root from being able to log in via VNC (i.e. remotely). Can I do that? If necessary, I can exclude root from the KDE desktop altogether, but it would be best if I could just exclude remote VNC desktop sessions.
Can't speak for lightdm, but as no-one else has posted: xdm has a "xlogin.Login.allowRootLogin" resource you can set true/false. Perhaps lightdm has something equivalent.
I had a quick google and couldn't see anything similar to the options that kdm/xdm provide in lightdm.
Short of doing something hackish like the following at the start of the session-startup script I'm not sure what you could do (note: this is not ideal as it will happen post-authentication). [ "$(/usr/bin/id -u)" = '0' ] && exit 0
Alternatively, you could just choose to use a more functional display manager...
If this is for your ivandi-PAM-enabled version of Slackware AND you're using tigervnc from the Slackware64-14.2/extra/ directory ...
If not, never mind
If so, you MIGHT be able to rebuild tigervnc to include PAM support by applying the patch below my sig to the Slackware tigervnc.SlackBuild script.
With that, you'll need an /etc/pam.d/tigervnc file which is which is one place that you could disable root logins via vnc ...
I also see that tigervnc 1.7.0 is available and it is natively compatible with xorg 1.18 so as long as you're rebuilding tigervnc you might want to try the latest, maybe after you've got a fresh build of tigervnc-1.6.0 ...
But then again, Slackware includes a 'buncha' patches with 1.18 in the name, so maybe not
-- kjh
These are the Patches for tigervnc 1.60 on Slackware64-14.2:
Yes, I'm using the Ivandi PAM-enabled lightdm. The solution on that link worked, which is to put the following line in /etc/pam.d/lightdm:
auth required pam_succeed_if.so user != root quiet
I'm currently using x11vnc, not tigervnc, but your idea is worth investigating. However, in the configuration I'm using, the user only has ONE login to deal with -- the VNC server does not do additional interactive authentication. Still, your procedure on that is worth keeping.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.