I am running Ubuntu GNOME 14.04, using gdm display manager and gnome-shell environment and I need to achieve the following behaviour: after boot, a selected user is automatically logged in, but a password is still needed to access the session. Or in other words, after the user is automatically logged in, the screen is locked immediately.

The user login is specifically needed; it's not about starting a service at boot time (which is achievable with different means).

Is this behaviour possible? If so, how to do it in the most clean and non-hacky way? Changing the display manager or the environment is not an option.

Thanks for any input.

share|improve this question
    
possible duplicate of How to automatically lock my computer after logged in via auto login – ike Jun 19 '15 at 18:09
up vote 4 down vote accepted

Enable auto login.

Check whether you have installed gnome-screensaver by running following command.

sudo dpkg --get-selections | grep gnome-screensaver

If it is not installed run following command to install gnome-screensaver.

sudo apt-get update && sudo apt-get install gnome-screensaver

Add this command on Startup application.(To open startup application preferences search "Startup applications" on Unity dashboard.

/usr/bin/gnome-screensaver-command -l

enter image description here

This screenshot is a Unity screenshot. But this works on GNOME shell without any modification.

share|improve this answer
    
Needed to install gnome-screensaver, but works like a charm. Thanks! – zegkljan Oct 20 '14 at 10:35
    
Cheers! I'll add it to answer. Thank you – dedunumax Oct 21 '14 at 5:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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