4

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.

zegkljan
  • 428
  • 7
  • 19

1 Answers1

5

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.

Latest Ubuntu version has a command called loginctl. You can replace startup command with below command and get the same thing done.

loginctl lock-session

dedunu
  • 9,556