What follows are few tips on how to lock screen on a Linux system running KDE4 desktop manager. This is quite effective if you forget to lock your screen on your working Linux desktop in the office and you do not wish anyone to tinker with your box.

To lock your KDE4 screen locally all you need to do is to run a following command:
$ /usr/lib/kde4/libexec/kscreenlocker --forcelock
Here is how you can lock screen as a root user from virtual console. Please note that root password will be required to unlock screen:
# export DISPLAY=:0.0
# xhost +local:root
# /usr/lib/kde4/libexec/kscreenlocker --forcelock

Next, let's see how we can lock KDE4 screen remotely. Login remotely via ssh to your desktop:
$ ssh -X lubos@my-kde4-desktop
Once you ssh to your remote system execute a following command to lock your screen:
$ DISPLAY=:0.0; /usr/lib/kde4/libexec/kscreenlocker --forcelock

Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top