Bug 300151 - Lock session after auto-login
Summary: Lock session after auto-login
Status: RESOLVED UNMAINTAINED
Alias: None
Product: lightdm
Classification: Miscellaneous
Component: greeter (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Edmundson
URL: https://bugs.launchpad.net/lightdm/+b...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-16 17:27 UTC by Geert Lamers
Modified: 2020-10-10 21:20 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geert Lamers 2012-05-16 17:27:06 UTC
I'd like to see the option to lock the session after auto-login.

This makes it possible to start the system and load the default session without requiring any action from the user. But the session is stil safe because it requires a password before it can be used.

KDM supports this functionality, and I'd like to use it with LightDM as well.
Comment 1 David Edmundson 2012-05-16 17:32:13 UTC
Just so I understand, what's the use case?
Just for speed when you do get round to logging in?
Comment 2 Geert Lamers 2012-05-16 17:46:33 UTC
Basically it's about speed, yes.

My PC is a single-user system. Right now the boot process is interrupted while it's waiting for a username and password. 

What I have to do is wait for the OS to boot, enter my username and password, wait for the session to load (I've got a bunch of applications to auto-start so it takes a little while), then I can start using it. 

What I used to do with KDM was turn my PC on, leave the room to do something else while it boots, enter password and have a fully loaded session right away. The current auto-login is not really an option since it leaves an unlocked session, where everyone can read whatever happens to pop up on the screen, or even touch it.
Comment 3 David Edmundson 2012-05-18 20:10:59 UTC
Relevant snippit from KDM
    if (td->autoLock && cursource == PWSRC_AUTOLOGIN)
        env = setEnv(env, "DESKTOP_LOCKED", "true");

We can't really set envs from the greeter (it would go against the point of the design if we could) so the next question is how can we do it?

Also I want to research how common this option is used before I start implementing all the (random cruft) that KDM had.
Comment 4 David Edmundson 2012-12-10 23:47:44 UTC
Work around for now:

Save this to ~/.xprofile

DESKTOP_LOCKED=true
export DESKTOP_LOCKED
xprop -root -f  -set DESKTOP_LOCKED true

then set LightDM to auto-login.


I'm not adding it to the GUI with the current hack. I would consider doing it as a pre-session hook script, if that works.
Comment 5 Geert Lamers 2012-12-26 19:32:54 UTC
That seems to be working, thanks :)
Comment 6 Malte S. Stretz 2013-05-09 12:01:28 UTC
I added the LightDM Launchpad feature request in the URL field.

As a data point: I enable this option on all my and my families machines for the same reason Geert Lamers does. Especially on older machines it is quite helpful, people can just walk away while their machine boots up, fetch a coffee and come back to a properly locked but fully started session.
Comment 7 Malte S. Stretz 2013-05-09 12:21:52 UTC
Tried the workaround and the environment variable was enough for me, xprop not required.
Comment 8 Malte S. Stretz 2013-05-09 12:35:25 UTC
There's one difference in behaviour: The KDM solution locked the session only on auto-login, the xprofile variant also when you log out and in again. I can live with that but its a bit awkward.
Comment 9 Malte S. Stretz 2013-05-12 22:03:47 UTC
Looks like this was implemented in lightdm itself via the autologin-in-background setting, cf.
http://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1162511
http://bazaar.launchpad.net/~lightdm-team/lightdm/trunk/revision/1662
Comment 10 Nate Graham 2020-10-10 21:20:50 UTC
We no longer use lightDM, having moved to SDDM several years ago. As such, this bug report is no longer applicable. Bugs reports for the new SDDM-based login screen should be filed to one of two places:

1. Visual/UI bugs with the login screen UI itself, or feature requests: plasmashell | Theme - Breeze
2. Bugs with the login/user switching process: https://github.com/sddm/sddm/issues