Auto login root user at system start in Kali Linux – GNOME and KDE

Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security Ltd. Mati Aharoni and Devon Kearns of Offensive Security developed it by rewriting BackTrack, their previous forensics Linux distribution.

By default root is the only user account in Kali Linux. It doesn’t present any option to create another user during installation. It however presents an option to set root password during installation. You need root privileges to run pretty much everything in Kali Linux. You can create another non root standard user (See previous post: Add remove user (standard user/non-root) in Kali Linux) for day to day use given that Kali is your Primary Linux distribution but it might get tedious to type in the root password every time you login. This guide will show you how to make a simple few line changes to allow your auto login root  user at system start or boot time in both KDE and GNOME Desktop.

Auto login root user at system start in Kali Linux

By default Kali uses gmd3 (GNOME Display Manager). However, you can install KDE and use kdm in Kali Linux. I’ll show both auto login here.

Auto login – GNOME gmd3

Like I said it’s a simple change. Just open and edit the file called /etc/gdm3/daemon.conf, assuming you’re using GNOME Display Manager(gmd3) a your main Display Manager. You might want to try out other desktops as well. Here’s a link to Add/Remove different desktop Managers in Kali Linux.

root@kali:~# leafpad /etc/gdm3/daemon.conf

In the daemon section un-comment the 2 lines for automatic login. It should finally look like this

[daemon]
# Enabling automatic login
  AutomaticLoginEnable = true
  AutomaticLogin = root

Auto login root user at system start in Kali Linux - GNOME and KDE - blackMORE Ops

That’s it. Too easy. In case you’re wondering how to use a different user than root, here’s how

[daemon]
# Enabling automatic login
  AutomaticLoginEnable = true
  AutomaticLogin = myanotheruser

Reboot

Last but not the least, reboot to check if it worked. (which it will, cause it’s Linux and Kali is awesome)

reboot

Enjoy your auto autologin to Kali Linux GNOME gdm3.

Auto login – KDE kdm4

If you managed to install KDE and using KDM instead of GMD, the above process won’t work for you. So we need different instructions to auto login root user in Kali Linux KDE environment. In case you’re wondering how to install KDE, there’s a nice guide on How to Install KDE in Kali Linux.

Again this is a simple process. Edit the file called /etc/kde4/kdm/kdmrc, assuming you’re using KDE Display Manager(kdm4) a your main Display Manager.

root@kali:~# leafpad /etc/kde4/kdm/kdmrc

Add the following lines to the end of this file:

[X-:0-Core]
AllowRootLogin=true
AutoLoginAgain=true
AutoLoginDelay=0
AutoLoginEnable=true
AutoLoginLocked=false
AutoLoginUser=root
ClientLogFile=.xsession-errors

In this example AutoLoginUser specifies which user will auto login into KDE using kdm4. You can change it from root to myanotheruser.

Here’s the catch, you can’t autologin as root in KDE unless you specify AllowRootLogin=true. There’s multiple forums that talks about this, I have yet to find any other solution than outlined here. However, depending on how you’ve setup your KDE, you might already have some of stuffs in the section mentioned above. Just change values to match the code above and you’re all set.

Don’t forget to share with KDE buddies about this.

Reboot

As always reboot to confirm if auto login root user is working or not.

reboot

That’s it for Kali Linux KDE kdm4 auto login .

Conclusion

I can’t say if it’s a good idea to autologin to ANY linux system as root, (or to enable it to start with), but I am hoping you will not do this and leave your system unlocked in open area. I mean how hard it is for someone to come and erase your whole disk and you know what… Too easy. Some might argue to put a different username and then sudo into root account, but then again, it’s really upto the user on what they want to do.

I do this in my VirtualBox, so I can go away for a cup or coffee (cause coffee is absolutely utterly important to run Linux or Kali in general) and when I come back my Vbox is ready and all logged in.

Finally I would like to finish it up with a nice quote from Linus Torvalds
I started Linux as a desktop operating system. And it’s the only area where Linux hasn’t completely taken over. That just annoys the hell out of me.

This is so true about Kali..

Check Also

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

Enabling AMD GPU for Hashcat on Kali Linux: A Quick Guide

If you’ve encountered an issue where Hashcat initially only recognizes your CPU and not the …

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

Boot Ubuntu Server 22.04 LTS from USB SSD on Raspberry Pi 4

This is a guide for configuring Raspberry Pi4 to boot Ubuntu from external USB SSD …

22 comments

  1. if use ‘root’ , the better to give a custom password for ‘root’
    > passwd root

  2. Doesn’t work for me for some reason. I opened the file the values were already set to true – still prompts me on boot up…

  3. Thx, works for Debian 7.

  4. You are the man… Really love this site for learn about kali.
    Thanks man

  5. This shit just rekt my Kali Linux installation.

  6. Heyy what about XFCE auto login in kali linux

  7. Hi it is saying me if i editing daemon.conf it say me to bee root to do this how do become a root???

  8. Did not worked by me (Centos 6.6)

  9. hey i am a old follower of this website …. from last few weeks i did not visit here ,,,, but i show this post last time under the “20 things to do after installing the kali linux” post…. and i am searching the whole content at one place but i did not get all…. :(

    why you changed all content it a trouble for old followers….

    • Hi Roy,
      I am also thinking of turning Pagination off. Pagination was advised by a friend to make pages slightly faster (load time was exceeding certain thresholds). I might have to get more server resources or move to a different server entirely.
      Feel free to copy paste my site contents to somewhere else (I started off the same, a personal blog turned website where I used to keep articles that I like) and you can then control the formatting. In the meantime, I will try my best to change formatting but as you can imagine (and rightlyfully guess, web design is not my strong straits!). Thanks again for the feedback. Cheers,
      -BMO

  10. Im using Kali Linux 2 its not working for me its demand permission for modify file named deamon.conf pl z give me a solution

  11. I am a beginner and its working… I am a 4 OS user… order by – kali, win10, ubuntu, linux mint… which works perfectly in my elitebook 2540p laptop…

    -My doubt is , before i gone through this page, i dont know about gnome and kde…
    -And from the above procedures , KDE is working me… thanks a lot for letting me to know that i have using a KDE display manager…

  12. hi , im use kali 2 . after use this method : Auto login – GNOME gmd3 and reboot . i cant login kali . cant login user: root pass : toor .

    my user : kali pass: 8520 . now test very very user & every thing for user & pass but i cant login . please help me for back my kali

  13. thank you very much , it works :)

  14. really thanx………..

  15. thanx…….

  16. Hello,

    Latest version of Kali 2017 settings are changed I do believe.

    When you want to login as ‘user1’ the window where you do have to type in name and password is in a loop.

    [daemon]
    AutomaticLoginEnable=true
    AutomaticLogin=root
    TimedLoginEnable=true
    TimedLogin=root
    TimedLoginDelay= 10

    Enabling automatic login

    AutomaticLoginEnable = true

    AutomaticLogin = root

    Enabling timed login

    TimedLoginEnable = true

    TimedLogin = user1

    TimedLoginDelay =5 (changed that in 10) !!!

    Reserving more VTs for test consoles (default is 7)

    FirstVT = 9

    [security]
    AllowRoot = true

    [xdmcp]

    [greeter]

    Only include selected logins in the greeter

    IncludeAll = false

    Include = user1,user2

    [chooser]

    [debug]

    More verbose logs

    Additionally lets the X server dump core if it crashes

    Enable = true

    Greets to all.

    Keep up the good work, tnx BlackMoreOps.

    (10minute mail)

  17. Hello,

    Please accept my apology because I didn’t told you how I installed the last Kali Linux Dedbian Distro. (32bit version ISO 2.7G 2017.1)

    Download I’ve used came from: http://www. kali.org/downloads/

    Computer I’ve used to set up my Sandisk USB 3.0 stick was an ‘oldie’ made by myself running Win 10 + Creators update as OS.

    During the installation I’ve used some ‘handy software’.

    Diskpart
    Easeus Partition Master 12.0
    Mini Partition Wizard (nice to use building persistence)
    PendriveLinux

    A year ago made another USB with Kali using older software of the Kali distro and that one works like a charm, no problem to change root in ‘user1’. No problem with the window where you have to type name & password to go to ‘user1’ or go back to root.

    Trying over and over again in the latest Kali distro it wont work. Window is as I already wrote in a loop and didn’t show up.

    Changing settings in with leafpad as discribed hinger up won’t work with Kali 32bit version ISO 2.7G 2017.1.

    I can reach ‘user1’ when typing sudo su ‘user1’ but I don’t trust that because I think it stays ‘root’.

    Maybe helpful: Ctrl+Alt+F2?
    Sudo su ‘user1’

    Maybe I’m doing something terribly wrong or am I mistaken?

    I’m sorry.

    Graats to all ya folks,

    Pete.

  18. Sorry for the mistypo’s

    Greets to all ya folks, sounds better …

  19. root@kali:~# leafpad /etc/gdm3/daemon.conf
    If i type this then empty file with daemon.conf opens

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading

Privacy Policy on Cookies Usage

Some services used in this site uses cookies to tailor user experience or to show ads.