Auto-login in Slackware

Created: 2022-09-30 Updated: 2022-10-02

Slackware 15.0. (My main Slackware page.)

I’ve got two machines set to auto-login currently:

  1. A little desktop that boots into XFCE for the family entertainment center.

  2. A laptop that boots into the awesome window manager for my new Assembly Nights 2 (sneak preview!) setup.

Here’s what works in Slackware:

1. Set init to boot into run-level 4

The last person to edit /etc/inittab was Pat Volkerding himself and now you!

Set to 4 as explained in the comments:

# vim /etc/inittab


# These are the default runlevels in Slackware:
#   0 = halt
#   1 = single user mode
#   2 = unused (but configured the same as runlevel 3)
#   3 = multiuser mode (default Slackware runlevel)
#   4 = X11/Wayland with SDDM/KDM/GDM/XDM (session managers)
#   5 = unused (but configured the same as runlevel 3)
#   6 = reboot

# Default runlevel. (Do not set to 0 or 6)
id:4:initdefault:

2. Configure autologin with SDDM

By default, Slackware 15.0 will use SDDM, the Simple Desktop Display Manager (wikipedia.org) to manage the graphical login/session. I believe this comes with KDE, but it will happily launch any desktop environment (DE) or window manager (WM).

Apparently the options available are to be found in /usr/share/xsessions/ and after installation, awesome is included there. Here’s the whole list:

  • awesome (because I installed the awesome wm)

  • xfce

  • plasma

  • xwmconfig

  • z_plasma-safe

Here’s my sddm.conf settings for the laptop with awesome:

# vim /etc/sddm.conf


[Autologin]
# Whether sddm should automatically log back into sessions when they exit
Relogin=false

# Name of session file for autologin session (if empty try last logged in)
Session=awesome

# Username for autologin session
User=dave

On the family entertainment pc, I’ve got:

Session=xfce
User=fam

(By the way, you might be tempted to use the minimalist XDM for this since we don’t even need to see the graphical login. But XDM doesn’t support autologin, so don’t bother.)

Autologins and the gnome-keyring prompts

Once you set your system to autologin, you’ll probably start seeing dialogs occasionally pop up asking you for a password to unlock your keyring.

Short answer: It’s fine, enter your login password.

There are at least four things that are extremely bothersome (at best and terrifying at worst) about this dialog:

  1. It doesn’t identify itself! All you see is "Unlock Login Keyring" or some such in the title bar, so there’s no way to find out more about it other than to search for the title on the Web.

  2. It doesn’t tell you which application is requesting the keyring!

  3. What password? I don’t remember creating any keyring password!

  4. What even is a keyring? I don’t remember creating a keyring.

Here’s what I understand about this:

First of all, this thing is gnome-keyring-daemon and you can learn more about it with man gnome-keyring-daemon

Something requested it through the communication channel known as DBus. You can see the Gnome Keyring Daemon listening with this query:

$ qdbus | grep gnome
 org.gnome.keyring

Apparently, when you created your user account and set a password, a keyring was created for you with the same password. I believe you’ll find it here on Slackware:

$ ls .local/share/keyrings/
login.keyring  user.keystore

(I think it’s the login.keyring one.)

Furthermore, when you log in, this keyring is automatically "unlocked" for you with the same password. This is why you’ve never interacted directly with this thing before.

So when you auto-login, you’re no longer entering your password and apparently the automatic keyring unlock is also not happening.

The reason this prompt is coming up is that something asked for it. In my case, it’s Firefox. I can tell because the prompt comes up almost immediately and keeps coming up every five minutes or so (I haven’t bothered timing it, sorry) until I close Firefox.

I’ve concluded that this behavior is ultimately a good thing. The gnome-keyring-daemon is "protecting my keys" for me even though I’ve chosen to reduce my security on this machine with autologin. So I will enter my login password when this pops up at a reasonable time (such as when I start Firefox).

But make no mistake: I think the way this thing presents itself is unacceptable and I find it difficult to understand how this as allowed to be released into the wild like this. There should at least be some sort of help button to get more information about what this darn thing is and why it is asking for your password!!!

Why autologin?

I set up a family "entertainment PC" in the basement. It was one of those SFF (small form-factor) corporate boxes with a Core I7 and 16Gb of RAM and it fits perfectly next to the receiver in our typical "entertainment unit" below the big flat screen.

Now anyone in the family can just hit the power button on the PC and be looking at the friendly XFCE desktop in moments. (The computer’s name is banana and I found a cute little cartoon banana wallpaper that makes everybody smile when it comes up.)

On my personal dev laptop, I’m always working on a specific project and want to have a completely frictionless experience to make it as easy as possible to add as little as a single line of code each night. (I’ve written before about falling asleep at the login prompt.)

Anyone with physical access to these computers could yank the drives and bypass my logins anyway, so security isn’t an issue here. Nor am I concerned about one of the kids "breaking in" and messing something up because nothing non-ephemeral is stored on them.

My work desktop that pays the bills and keeps a roof over our heads boots to a login prompt (non-graphical) and it will remain that way. :-)