In openSUSE and SLES, the system can be configured to log in automatically without requiring a password. This is the default setting during installation. While convenient for single-user environments, it poses a security risk. Anyone with physical access to the system can log in to the default account, which often has administrative privileges.

To maintain security, it is important to manage the automatic login feature. Disabling this feature ensures that a password is required to access the system, which prevents unauthorized access. On the other hand, enabling it can be useful for certain controlled environments where security is not a primary concern.

You can enable or disable automatic login using either the graphical YaST tool or the command line in openSUSE and SLES. Both methods offer straightforward ways to configure the system according to your needs.

Methods to enable or disable automatic user login in openSUSE and SLES:

Steps to enable or disable autologin in openSUSE and SLES using YaST:

  1. Open the YaST application.
  2. Navigate to Security and UsersUser and Group Management.
  3. Click on Expert OptionsLogin Settings on the lower right of the window.
  4. Check or uncheck the Auto login box to enable or disable automatic login and click OK.
  5. Click OK again in the main window.
  6. Restart the system for the changes to take effect.

Steps to enable or disable autologin in openSUSE and SLES from command line

  1. Open Terminal application.
  2. Edit /etc/sysconfig/displaymanager using your preferred text editor.
    > sudo nano /etc/sysconfig/displaymanager
  3. Find the DISPLAYMANAGER_AUTOLOGIN directive.
    ## Type: string
    ## Default:
    #
    # Define the user whom should get logged in without request. If string
    # is empty, display standard login dialog.
    #
    DISPLAYMANAGER_AUTOLOGIN="user"
  4. Enter a username in the directive to enable autologin or remove existing username to disable autologin.
    DISPLAYMANAGER_AUTOLOGIN=""
  5. Save and exit the text editor.
  6. Restart the system to apply the changes.

Tested on:

Distribution Version
openSUSE Leap 15.5
Discuss the article:

Comment anonymously. Login not required.