Howto lock your screen in Backtrack 5 gnome

´╗┐One of the most annoying features of Backtrack 5 is that you can no longer lock the screen when you want to go away from your keyboard. In this post, I will give a Howto on an alternative way to lock your screen when you are logged in as root. One thing to point out is that if you look up the documentation of xscreensaver-command or gnome-screensaver, the developers state that the reason a screen doesn’t lock as root is because it is a bad security practice to be logged in as root. Although I agree with them, it is an ever worse practice that one cannot lock their screen as root, so shame on those lazy developers. Here is an alternative way to lock your screen when you are away from your keyboard in Backtrack 5 gnome edition:

  1. Install xlockmore via the command line by running the command – aptitude install xlockmore
  2. Go to System -> Preferences -> Keyboard Shortcuts
  3. Find the shortcut labeled “Lock screen”
  4. Click on it and set the shortcut to disabled by pressing the backspace button
  5. At the bottom of the screen click “Add”
  6. For the name enter in something like “Lockscreen”
  7. For the command enter in “xlock”
  8. Click Apply
  9. Click on the newly created menu item you made “Lockscreen” at the bottom of the list and press CRL+ALT+L or whatever you want to bind your screen locking key to be.
  10. Click Close
  11. Vuala! Now you can lock your screen by pressing the key you bound.

Notes: I had this freeze once for me before, but after the initial installation I rebooted and I never got another frozen screen.

Hope that helps! Enjoy!

Tags: , , , , , , ,

Friday, June 24th, 2011 at 12:59 am • HowtoRSS 2.0 feed • leave a response or trackback

11 Responses to “Howto lock your screen in Backtrack 5 gnome”

  1. eXP says:

    Thanks for the tip it was helpful!

  2. You’re most welcome. I’m glad to see someone has found this article and that it was useful to them.

  3. Bob says:

    Be careful if you are using disk encryption: the instillation of this will overwrite the boot loader and remove a few key encryption packages. I had to wipe and reinstall after doing this.

  4. I wonder if he was talking about the linux disk encryption package dm-crypt, truecrypt, or some other package. Seems odd that aptitude would “overwrite the boot loader” from installing a package. My guess is that some of the libraries for xlock were incompatible with what disk encryption package he was using and aptitude either uninstalled old ones and put in new ones, or somehow changed the dependencies for the disk encryption package. This story seems to remind me of a quote from the sudo command:

    “We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.”

  5. Nameless says:

    Same experience as Bob. If you’ve setup encryption as per this tutorial (, it will render your install unbootable.

  6. Nameless says:

    A bit further on my last comment and on Bob’s comment.

    If your install was setup with encryption as above and you found yourself unable to boot after doing this, you can fix it by:

    - Booting from another copy of Backtrack 5
    - Installing hashalot and lvm2
    - Mount the encrypted volume and chroot into it
    - Run ‘apt-get install cryptsetup ecryptfs-utils keyutils’

    That seems to replace any required packages that were removed or modified by xlock. At least, it worked to repair my install. I expect that running the apt-get install command immediately after step #1 of this guide would work as well, without the hassle of booting from a second drive/disc.

  7. undr5crl says:

    rather than using aptitude to install the package, just apt-get it

  8. Prakash says:

    well, the xlock crashes and the system is unlocked on BT5 .

  9. glx says:

    run xlock press Ctrl+Alt+F1 Enter
    Ctrl+c Enter

  10. Thank you for pointing out vulnerabilities. Apparently this method is flawed.

  11. Dr _ Comp says:

    Great . Thanks For sharing information.

Leave a Reply