Using Ubuntu 12.04.

I'd like to know if it is possible to set a different password for Ubuntu screensaver or not?


It is possible. There are two ways of doing it:

Option 1: xlock - this program can lock your screen and has an option where you can specify the unlock password.

create encrpyted password:

openssl passwd -crypt

lock with custom password:

xlock -cpasswd crypted-password

The ubuntu package for xlock that I tried didn't have the -cpasswd option, so you might have to compile it from source to use that option.

Option 2: xscreensaver is an alternative to gnome-screensaver. There is this howto that show you how to set it up in Ubuntu. Once setup you can create a dummy user on your machine and set whatever password you want for the screensaver through that user. Then you run the screen saver as that user, that way when the screensaver comes up it will ask you to enter that users password. I tried and tested this method just now it works.

allow dummyuser to access your screen

xhost +

run screensaver as dummyuser

sudo -u dummyuser xscreensaver -no-splash
| improve this answer | |
  • that's awesome man . its saying that its could be done. thank you . I'll try and let you know . – rɑːdʒɑ Oct 5 '12 at 0:34
  • 3
    With Linux never take no for an answer, it can always be customized! – Marwan Alsabbagh Oct 5 '12 at 6:35
  • If you want to do this securely, and with the included screen locking support, you will have to patch it very heavily. While it is possible to use other methods, some of which are quite insecure, I would highly recommend against it. In particular, xhost + is not secure at all. – dobey Oct 5 '12 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.