This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to disable switch user and lock in KDE?

Tags: None
(comma "," separated)
zgong
Registered Member
Posts
2
Karma
0
Hi,

We are using RHEL 7.4 with KDE 4.10.

I would like to find out how to disable the Switch User and Lock in Leave Menu.

I don't want to disable Switch User and Lock button in the Leave Menu at system level. Instead, I would like to do it at user level. That is, I would like to configure a special user's .kde/share/config file and when this special user logins, he will not see the Switch User and Lock button in the Leave Menu.

I tried to put below contents in .kde/share/config/kdeglobals of intended user.

[KDE Action Restrictions]
lock_session=false
switch_user=false

Then I restart the session and check again, but it doesn't work.

Please advise how to do this in KDE?

For your reference, that is how we did it in Gnome3:

dbus-launch gsettings set org.gnome.desktop.lockdown disable-user-switching true
dbus-launch gsettings set org.gnome.desktop.lockdown disable-lock-screen true

Thanks,
Zaiwen
zgong
Registered Member
Posts
2
Karma
0
Hi,

I have got it to work with the help from KDE enterprise developer!

First, the relevant file should be whatever kdeglobals file the command "kde4-config --path config" lists.

Second, need to set the config to:

switch_user=false

*as well as*

action/switch_user=false

It is a bug in the underlying code, one of the many things that got fixed properly when they redid everything in Plasma5. It's much improved in this area.


In my case, what I did was:

1. "kde4-config --path config" returns:

~/home/zaiwen/.kde/share/config/:/etc/kde/:/usr/share/kde-settings/kde-profile/default/share/config/:/usr/share/config/

2. Go through all the folders and find two kdeglobals files:

~/home/zaiwen/.kde/share/config/kdeglobals
/usr/share/kde-settings/kde-profile/default/share/config/kdeglobals

3. Update ~/home/zaiwen/.kde/share/config/kdeglobals with:

[KDE Action Restrictions]
action/switch_user=false
switch_user=false
action/start_new_session=false
start_new_session=false
action/lock_screen=false
lock_screen=false

4. Update /usr/share/kde-settings/kde-profile/default/share/config/kdeglobals. In this file, it contains one line which doesn't allow users to change KDE Action. Remove this line:

[KDE Action Restrictions][$i]

Now when I login, "Switch User" and "Lock" are removed from the Leave menu!

Thanks,
Zaiwen
qwertier
Registered Member
Posts
1
Karma
0
Hi,
KDE Plasma 5.12.6
KDE Frameworks 5.44.0
I've stuck with the same problem: I had not found any option to disable Screen Lock feature.
Here is my workaround to the problem...

This app is a screen locker as it is:
Code: Select all
/usr/lib/x86_64-linux-gnu/libexec/kscreenlocker_greet

Code: Select all
stat kscreenlocker_greet
  File: kscreenlocker_greet
  Size: 153744          Blocks: 304        IO Block: 4096   regular file
Device: 813h/2067d      Inode: 11278917    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-09-21 13:07:07.625576537 +0300
Modify: 2018-06-30 20:28:53.000000000 +0300
Change: 2018-09-21 10:52:47.823141976 +0300

Look at this line:
Access: (0755/-rwxr-xr-x)

The file is marked as executable for all.

Let's disable execution:
Code: Select all
sudo chmod a-x /usr/lib/x86_64-linux-gnu/libexec/kscreenlocker_greet

Now see this:
Code: Select all
stat kscreenlocker_greet
  File: kscreenlocker_greet
...
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
...


The system can't run this file and you'll never see the screenlocker window again!


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]