lightDM: No auto login in CLI mode; no solution found online.
by KaliBob from LinuxQuestions.org on (#5PEYK)
OS: Kali 2021.2
System: Rpi4/Rpi0w
Quick Rundown:
Environment: Kali linux 2021.2 ARM image with lightDM graphical environment set to autologin by modifying /etc/lightdm/lightdm.conf on lines 126 and 127. (Default user set to "kali"; user timeout set to "0").
Problem: When systemctl default is changed from "graphical" (boots to desktop) to "multi-user" (boots to terminal/no desktop), the auto login stops working. This makes sense because auto login is controlled by the lightDM.conf file and if lightDM is not launched, the lightdm.conf file is irrelevant. So I need a way to set autologin for multi-user.target
What I've tried:
modify lightdm.conf to allow auto login. Result: Works for desktop environment, does not work for booting straight into terminal.
modify a pam.d file that I read about on another forum by commenting out one line. Result: no effect on terminal login issue, causes graphical auto login to stop working. Reverted the pam.d file to its original state and graphical auto login works again, CLI auto login (expectedly) still does not.
Hello all,
I have gotten Kali to auto login for me in the lightdm graphical environment which is used by the Kali ARM image for Raspberry Pi by editing the lightdm.conf file to set the default user. Now when I boot Kali, I do not need to enter a username or password; it goes straight to the desktop and I can do this as either the default user "kali" or as root. But I ultimately will not require a graphical environment at all. Raspberry Pi, especially the 0w, is rather "challenged" in the hardware department which comes as no surprise, so an obvious benefit would be disabling the desktop environment all together to conserve system resources. I can do this with the following:
Code:sudo systemctl set-default multi-userand then rebooting
Code:sudo shutdown -r nowUpon rebooting the system, it boots directly to a terminal the way the old Backtrack OS used to which is exactly what I wanted, but unfortunately the auto login will not work. Looking at the above command, one can easily note the argument "multi-user", which implies that there are...well, multiple users. And how is the computer to know which user to log in until user input is provided? Therein (I believe) lies the problem.
Therefore, I tried:
Code:systemctl set-default kaliand
Code:systemctl set-default rootboth of which were not valid as "kali.target" and "root.target" do not exist, so the terminal says. But it was worth a shot I suppose.
I am looking for a solution to auto-login while multi-user.target is the default boot parameter (or a different parameter can be used if necessary to accomplish this). I have scoured the internet with no successful configuration yet discovered. Several walkthroughs also mention needing to modify a pam.d file in /etc/, however I have found that by commenting out the appropriate line of the pam.d file, not only does auto login not work when set to multi-user, it also stops working with graphical boots. So modifying the pam.d file is obviously not the answer I was looking for.
The purpose behind this task is to run a headless Raspberry Pi (no mouse/no keyboard/no monitor) that I can simply turn on and know that in 60 seconds I'll be booted up and logged in. Once the login is complete, the SSH service can start automatically and I can use an SSH client on a remote device to log in to the Pi and control it remotely. While I am technically able to make this work in its current state by just booting to the desktop, it would be nice to not have to load a full blown graphical environment bogging the system down, especially for the lightweight Pi0w.
Thanks for any help anyone can give me for enabling autologin while multi-user.target is the default.
System: Rpi4/Rpi0w
Quick Rundown:
Environment: Kali linux 2021.2 ARM image with lightDM graphical environment set to autologin by modifying /etc/lightdm/lightdm.conf on lines 126 and 127. (Default user set to "kali"; user timeout set to "0").
Problem: When systemctl default is changed from "graphical" (boots to desktop) to "multi-user" (boots to terminal/no desktop), the auto login stops working. This makes sense because auto login is controlled by the lightDM.conf file and if lightDM is not launched, the lightdm.conf file is irrelevant. So I need a way to set autologin for multi-user.target
What I've tried:
modify lightdm.conf to allow auto login. Result: Works for desktop environment, does not work for booting straight into terminal.
modify a pam.d file that I read about on another forum by commenting out one line. Result: no effect on terminal login issue, causes graphical auto login to stop working. Reverted the pam.d file to its original state and graphical auto login works again, CLI auto login (expectedly) still does not.
Hello all,
I have gotten Kali to auto login for me in the lightdm graphical environment which is used by the Kali ARM image for Raspberry Pi by editing the lightdm.conf file to set the default user. Now when I boot Kali, I do not need to enter a username or password; it goes straight to the desktop and I can do this as either the default user "kali" or as root. But I ultimately will not require a graphical environment at all. Raspberry Pi, especially the 0w, is rather "challenged" in the hardware department which comes as no surprise, so an obvious benefit would be disabling the desktop environment all together to conserve system resources. I can do this with the following:
Code:sudo systemctl set-default multi-userand then rebooting
Code:sudo shutdown -r nowUpon rebooting the system, it boots directly to a terminal the way the old Backtrack OS used to which is exactly what I wanted, but unfortunately the auto login will not work. Looking at the above command, one can easily note the argument "multi-user", which implies that there are...well, multiple users. And how is the computer to know which user to log in until user input is provided? Therein (I believe) lies the problem.
Therefore, I tried:
Code:systemctl set-default kaliand
Code:systemctl set-default rootboth of which were not valid as "kali.target" and "root.target" do not exist, so the terminal says. But it was worth a shot I suppose.
I am looking for a solution to auto-login while multi-user.target is the default boot parameter (or a different parameter can be used if necessary to accomplish this). I have scoured the internet with no successful configuration yet discovered. Several walkthroughs also mention needing to modify a pam.d file in /etc/, however I have found that by commenting out the appropriate line of the pam.d file, not only does auto login not work when set to multi-user, it also stops working with graphical boots. So modifying the pam.d file is obviously not the answer I was looking for.
The purpose behind this task is to run a headless Raspberry Pi (no mouse/no keyboard/no monitor) that I can simply turn on and know that in 60 seconds I'll be booted up and logged in. Once the login is complete, the SSH service can start automatically and I can use an SSH client on a remote device to log in to the Pi and control it remotely. While I am technically able to make this work in its current state by just booting to the desktop, it would be nice to not have to load a full blown graphical environment bogging the system down, especially for the lightweight Pi0w.
Thanks for any help anyone can give me for enabling autologin while multi-user.target is the default.