LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-17-2016, 10:14 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
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.
 
Old 10-19-2016, 08:25 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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.
 
Old 10-22-2016, 12:48 AM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
GazL: Thanks for making the effort. To everyone else, hey! I thought this Slackware forum was the GoTo spot for things KDE!?

I found the answer for KDE: In the file /etc/kde/kdm/kdmrc, set: AllowRootLogin=false

However, this didn't work for me even after restarting init level 4. Perhaps it requires a reboot? I'm not in a position to test that yet.

I'm thinking that won't work either because it's lightdm that does the logging in.

I'll experiment more and report back.

Last edited by mfoley; 10-22-2016 at 12:53 AM.
 
Old 10-22-2016, 03:16 AM   #4
HermanAB
Member
 
Registered: Jun 2016
Location: Al Ain, UAE
Distribution: Slack, Fedora, Ubuntu, OpenBSD
Posts: 38

Rep: Reputation: Disabled
There are various ways - i.e. use sudo and delete the root password.
 
Old 10-22-2016, 04:58 AM   #5
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by mfoley View Post
GazL: Thanks for making the effort. To everyone else, hey! I thought this Slackware forum was the GoTo spot for things KDE!?

I found the answer for KDE: In the file /etc/kde/kdm/kdmrc, set: AllowRootLogin=false

However, this didn't work for me even after restarting init level 4. Perhaps it requires a reboot? I'm not in a position to test that yet.

I'm thinking that won't work either because it's lightdm that does the logging in.

I'll experiment more and report back.
mfoley --

Maybe try the same in /usr/share/config/kdm/kdmrc ?

HTH

-- kjh

Code:
# less /usr/share/config/kdm/kdmrc
:
<<snip>>
# Allow root logins?
# Default is true
AllowRootLogin=true
<<snap>>
:
 
Old 10-22-2016, 05:08 AM   #6
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Oops. you're running lightdm, not kdm.

Since this may be for your PAM-on-Slackware endeavor and if you have an /etc/pam.d/lightdm config, maybe the last post on this thread in the Debian Forum will work for you ?

-- kjh
 
2 members found this post helpful.
Old 10-22-2016, 05:26 AM   #7
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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...

Last edited by GazL; 10-22-2016 at 05:34 AM.
 
Old 10-23-2016, 08:30 AM   #8
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
mfoley --

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:

Code:
# pwd

/home/dld/slackware/slackware-14.2-64/extra/source/tigervnc

# ls -la patches

total 32
drwxr-xr-x 2 4015 4015 4096 Nov 12  2015 .
drwxr-xr-x 4 4015 4015 4096 Nov  7  2015 ..
-rw-r--r-- 1 4015 4015 5108 Nov 12  2015 tigervnc-xorg118-QueueKeyboardEvents.patch
-rw-r--r-- 1 4015 4015  509 Nov 12  2015 tigervnc.support.xorg.118.patch
-rw-r--r-- 1 4015 4015  330 Apr 11  2015 tigervnc13_link_png.patch
-rw-r--r-- 1 4015 4015 5356 Jul 11  2015 xserver118.patch
This is a unified diff where I turned on PAM for the Slackware 14.2 tigervnc.SlackBuild

Code:
--- /tmp/tigervnc.SlackBuild.orig       2016-04-05 20:45:45.000000000 -0500
+++ /tmp/tigervnc.SlackBuild    2016-10-23 08:10:56.945636566 -0500
@@ -204,7 +204,9 @@
 sed -e 's,set(MAN_DIR "${DATA_DIR}/man"),set(MAN_DIR "${MAN_INSTALL_DIR}"),' \
     -e 's,set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/,set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/,' \
     -i CMakeLists.txt
-
+#
+# kjh turned on -DENABLE_PAM for ivandi-PAM-enabled Slackware64-14.2
+#
 mkdir -p build
 cd build
   echo -e "\n*** Building vnc client ***\n"
@@ -217,7 +219,7 @@
     -DMAN_INSTALL_DIR=/usr/man \
     -DSYSCONF_INSTALL_DIR=/etc \
     -DLIB_SUFFIX=${LIBDIRSUFFIX} \
-    -DENABLE_PAM:BOOL=OFF \
+    -DENABLE_PAM:BOOL=ON \
     -DBUILD_JAVA:BOOL=${CMAKE_JAVA} \
     ..
   make V=1 $NUMJOBS || make || exit 1
 
Old 10-23-2016, 11:21 AM   #9
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by kjhambrick View Post
Oops. you're running lightdm, not kdm.

Since this may be for your PAM-on-Slackware endeavor and if you have an /etc/pam.d/lightdm config, maybe the last post on this thread in the Debian Forum will work for you ?

-- kjh
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.
 
  


Reply

Tags
kde, lightdm, root login



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linux Ent 5 only root logging in.not other users logging authentication failure error ravikavala Linux - General 1 09-30-2014 03:46 AM
[SOLVED] 1. Expunge new install of all kde; & 2.exclude kde from further updates & upgrades textillis Slackware - Installation 8 05-22-2013 04:23 PM
logging in KDE as root stupeas Linux - Newbie 6 02-03-2007 06:33 PM
Logging into KDE as root in Mandrake 10.1 CaptainRon Linux - Software 2 04-04-2006 05:34 PM
using red-carpet without logging out and logging as root. packman Linux - Software 1 12-09-2002 02:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration