Friday, November 15, 2013

Xubuntu - Remotely lock/unlock your monitor using an Android phone

Today, I looked for a way to lock a Xubuntu machine remotely, and after a while of googling, I figured out this method:

1. I created 2 alias command to lock and unlock the monitor's screen (xscreensaver) in /home/myuser/.bash_aliases:

alias lock='export DISPLAY=:0.0; xflock4;'
alias unlock='export DISPLAY=:0.0; kill -9 "$(pidof xscreensaver)"; xscreensaver -no-splash &'

2. Install JuiceSSH (a ssh client) app in my Android phone:

3. From my Android, connect to the Xubuntu machine via SSH with username 'myuser', and then:

To lock the screen, type this in my phone terminal:

$ lock

And unlock the screen with:

$ unlock

It's just fascinating! Feel like a hacker!!! \m/\m/\m/