Auto-login straight into desktop on Debian 7 with LXDE

23,099

This is really easy to do.

Open the file /etc/lightdm/lightdm.conf and navigate to line 78 (you can enable line numbers on Leafpad).

It should be saying #autologin-user=.

Remove the # and change it to have your username after (for example: autologin-user=test).

Reboot your machine and wait a little.


For more informations, you can also check https://askubuntu.com/questions/426831/lxde-auto-login


If you are using Debian 9, check https://superuser.com/a/1337778/777328
(Thank you Adrian W for the link!)

Share:
23,099
Ismael Miguel
Author by

Ismael Miguel

Updated on September 18, 2022

Comments

  • Ismael Miguel
    Ismael Miguel over 1 year

    Yesterday I have installed Debian on a virtual machine.

    I have SSH configured and everything set up.

    I don't like developing inside a VM.
    It doesn't help to resize the browser and test everything the way I want.

    So, I decided to connect using Xming and PuTTY, which works flawlessly.

    The boring stuff is that I have to always choose a username and password to be able to use the machine.

    How can I set it to automatically login into the desktop without asking username or password?

    EDIT
    Author says re ssh keys "It's not that. I just want that when I boot the VM, it goes straight to the desktop instead of the LXDE login screen. Everything else is working perfectly. "

    • Ismael Miguel
      Ismael Miguel over 9 years
      @barlop I was explaining WHY I want to do on this way. I can remove those lines if needed. The question itself might be badly worded, but it is no reason to downvote. I just want to skip the login screen and go to the desktop.
    • barlop
      barlop over 9 years
      +1 yeah I removed the downvote even before your comment, 'cos at least the question is interesting..but it's annoying that your question looked like you might've needed to know about ssh keys (talking about ssh and wanting to log in automatically) when you later say you weren't asking about ssh keys. Also at least you responded fast to say you didn't
    • Ismael Miguel
      Ismael Miguel over 9 years
      @barlop I'm really sorry for the wording. Your edit looks great! Can you please remove the line saying "I have SSH configured and everything set up."? And change "The boring stuff is that I have to always choose a username and password to be able to use the machine." to "The boring part is that I have to login first to the desktop to use it."? That might help a lot more to define what I want.
    • barlop
      barlop over 9 years
      ok but first, to clarify, which machine is it that you have to use the username and password to get into? can you provide a screenshot (could be a pic taken from your phone), or something from google images, that shows the user/pass screen that you need to automatically get through? ('cos I guess you have a windows system a linux system and ssh and a pic would clarify what you mean)
    • barlop
      barlop over 9 years
      show a picture of the screen where you have to enter the username and are trying to do automatically
    • barlop
      barlop over 9 years
    • Ismael Miguel
      Ismael Miguel over 9 years
      @barlop I'm really Sorry, but the chat is all bugged. I will post the answer now.
    • barlop
      barlop over 9 years
      ok that's no problem, glad I could help. It's interesting what you are doing.. locally accessing the headless VM to a different view so as to avoid the virtual machine GUI quirks you've found. I like the idea.
    • Ismael Miguel
      Ismael Miguel over 9 years
      @barlop You have no idea how great it is to work like that! You just start the VM, wait 2 minutes, start PuTTY, connect to the VM and you can access the programs just like if you were using separate programs in windows. If you want to go crazy, you can start the XWindow manager (in my case, running the command startlxde&) and you can have both desktops at the same time. I don't recommend using the latest way
    • Ismael Miguel
      Ismael Miguel over 9 years
      @barlop If you have any doubt and you want to try it yourself, and you find any doubt, you can ask here and I will happily answer.
  • integratorIT
    integratorIT over 7 years
    I've installed debian 8.5 and LXDE and there is no /etc/lightdm/lightdm.conf file
  • Ismael Miguel
    Ismael Miguel over 7 years
    @infografik I know. This is specific to Debian 7. On Debian 8.5, it is a bit different. I can't say now because I don't remember how it is, but as soon as I get home (in 5 hours), I can tell how I've done with Debian 8.5. I have it working without GUI, and the setting to run GUI-less is on the same file.
  • Adrian W
    Adrian W over 5 years
    For newer Debian versions, see superuser.com/a/1337778/777328
  • Ismael Miguel
    Ismael Miguel over 5 years
    @AdrianW Done, added to the post. Thank you!
  • Rebroad
    Rebroad over 4 years
    This doesn't work on Raspbian 10.
  • Ismael Miguel
    Ismael Miguel over 4 years
    @Rebroad Raspbian 10 is not Debian 7.
  • Ismael Miguel
    Ismael Miguel over 4 years
    @Rebroad I stumbled across this answer on linux & unix: How do you make the HDMI hot-pluggable on a Pi?. It shows a window which might interest you.
  • SuperSafie
    SuperSafie almost 3 years
    It works on Debian 11 too