p1rat3
Posts: 3
Joined: Tue Jul 05, 2016 3:58 pm

Desktop autologin

Tue Jul 05, 2016 4:11 pm

Hello!

I was wondering if there is a specific reason for Ctrl+Alt+F1 dropping you into a logged-in tty1 console session even if the user has logged out in the GUI. I have tested on Raspbian on RPi 2 B when Desktop Autologin was selected with raspi-config. It seems like a vulnerability to me but I would appreciate another view.

Thank you!

hello world :-)
Posts: 121
Joined: Sat Nov 14, 2015 7:12 am
Location: England, in an insecure cloud, ie. The Interwebs
Contact: Website Yahoo Messenger AOL

Re: Desktop autologin

Thu Jul 07, 2016 12:39 pm

p1rat3 wrote:Hello!

I was wondering if there is a specific reason for Ctrl+Alt+F1 dropping you into a logged-in tty1 console session even if the user has logged out in the GUI. I have tested on Raspbian on RPi 2 B when Desktop Autologin was selected with raspi-config. It seems like a vulnerability to me but I would appreciate another view.

Thank you!
As far as I know, enabling the autologin option in raspi-config actually enables two separate autologin features, one for the terminal and another for the GUI. The autologin option can be manually enabled and disabled for both of them, hence logging out of one does not affect the other because they are separate, the raspi-config option just edits the configuration for both of them at once. See this (the article + the comments) for more info: http://unixetc.co.uk/2016/01/07/how-to- ... y-pi-user/
I do moral support. Here: https://www.raspberrypi.org/forums/search.php?search_id=egosearch
I know I use too many parentheses. Problem?
Topics I have posted in: http://bit.ly/1NbDdr5
My topics: http://bit.ly/1ObnKqQ
All my posts: http://bit.ly/1OHzje7

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Desktop autologin

Thu Jul 07, 2016 3:01 pm

p1rat3 wrote:Hello!

I was wondering if there is a specific reason for Ctrl+Alt+F1 dropping you into a logged-in tty1 console session even if the user has logged out in the GUI.
If you have it set for autologin it applies to both the console and desktop. If you log out of the desktop and go to console it will log you in automatically, since it's set for autologin.

For autologin it uses "autologin@.service". For a login prompt it uses "getty@.service". One of those will be linked to "getty@tty1.service" which is used by both the console and desktop.

That's what raspi-config does, it links either "autologin@.service" or "getty@.service" to "getty@tty1.service" depending on whether you choose to autologin or not.

So if you use this command

Code: Select all

 ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
that will set "getty@tty1.service" to autologin.

If you use this command

Code: Select all

 ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
that will set "getty@tty1.service" to provide a login prompt.

It doesn't matter if you're using "multi-user.target" (console), or "graphical.target" (desktop) they both use the same "getty@tty1.service". So if you link "autologin@.service" to it both the desktop and console will be set to use autologin. That's why it logs you in automatically if you switch to console.

p1rat3
Posts: 3
Joined: Tue Jul 05, 2016 3:58 pm

Re: Desktop autologin

Thu Jul 07, 2016 4:50 pm

Thank you for your answers, these are clear and very useful.

However, I am not asking how desktop (GUI) and console autologin is achieved but rather why it is configured this way.

I think the choices of either console or desktop autologin in raspi-config are misleading since the choice of desktop autologin also performs console autologin. On top of that, other Linux distributions' autologin feature (e.g. Ubuntu) does not also log you in a console. This is the default feature though in Raspbian and it might pose a security issue for users that would not expect to still be logged in in console after they already logged out in desktop.

So, why is this configuration useful? What are the pros of having it?

Although I think this (i.e. desktop+console autologin) should not be the default feature in an OS, I am not advocating that it has no pros but rather I am trying to find what these pros might be.

p1rat3
Posts: 3
Joined: Tue Jul 05, 2016 3:58 pm

Re: Desktop autologin

Tue Jul 12, 2016 3:22 pm

Anyone on why tty1 is configured to autologin as well (when just desktop autologin is selected) and also what this offers to the user?

Thanks!

Return to “Raspberry Pi OS”