How to Lock Your Machine and Display Application Screen

We have a couple monitoring applications running on our Linux desktop. To monitor server health, graph utilization through various network monitoring systems. Usually monitoring application required authentication and it will be a security issue if you left your Linux desktop unlock.

But if you lock your Linux desktop, the screen will goes blank and you can’t monitor what is projected on your screen. There is a way to do it with screen saver lock, where you can lock your Linux desktop and at the same time to display when application is running on your monitoring screen.

Lock Your Machine with xlock

First, install xlock in your Linux desktop

shell> sudo apt-get install xlock

After xlock has been install, create a file name lockscreen, chmod to 777 and paste the line below in the file

# /usr/bin/xlock -mode image -geometry 0x0 -timeout 1
shell> vi lockscreen
shell> chmod 755 lockscreen

xlock is screen saver lock, but it can disable the screen saver screen by setting display with “-geometry 0x0”.

You can also bind your keyboard short cut key to launch the lockscreen script through System > Preferences > Keyboard Shortcuts.