Results 1 to 30 of 30

Thread: Revert to Classic Command Line Login

  1. #1

    Revert to Classic Command Line Login

    There are occasions when I want to boot into Kali as quickly as possible to run a few simple tasks. So, rather than dealing with a Desktop Environment, I like the default to be simply command line and have the option to load gdm3 if needed. Here's how to do that:


    QUICK METHOD
    Quote Originally Posted by g0tmi1k View Post
    If you want a quick copy/paste method:
    Code:
    cp -n /etc/X11/default-display-manager{,.bkup}
    echo > /etc/X11/default-display-manager
    cp -n /etc/gdm3/daemon.conf{,.bkup}
    sed -i 's/^.*AutomaticLoginEnable = .*/AutomaticLoginEnable = True/' /etc/gdm3/daemon.conf
    sed -i 's/^.*AutomaticLogin = .*/AutomaticLogin = root/' /etc/gdm3/daemon.conf
    ln -s /usr/sbin/gdm3 /usr/bin/startx   # Old school ;)
    Thank you, g0tmi1k!


    STEP-BY-STEP WALKTHROUGH WITH EXPLINATIONS

    STEP 1: Remove our Default Display Manager.

    Since we don't want any graphical defualt display, we're going to simply clear the file out completely.
    First, open a terminal. Fom here, we will backup our default display manager before we clear it out:
    Code:
    cp /etc/X11/default-display-manager /etc/X11/default-display-manager.backup
    echo "" > /etc/X11/default-display-manager
    STEP 2: Set GDM3 to autologin.

    Since we're forced to login to even use the command line, there is really no reason to have GDM3 prompt us to login -- in a situation where we boot up wanting the desktop environment. So, we can tell gdm3 to autologin (to an account of your choosing) when, and if, you decide to load it.

    Code:
    cp /etc/gdm3/daemon.conf /etc/gdm3/daemon.conf.backup
    leafpad /etc/gdm3/daemon.conf
    Now, under section "[daemon]" we want to change both AutomaticLoginEnable and AutomaticLogin lines

    Code:
    [daemon]
    # Enabling automatic login
    #  AutomaticLoginEnable = true
    #  AutomaticLogin = user1
    Should now look like:

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

    Now, whenever you boot into Kali, you'll be prompted to login at the command line, rather than the gdm3 GUI. Once logged in, you can always startup your desktop environment by simply typing in
    Code:
    gdm3
    (optional) STEP 3: Use the the classic 'startx' command to run GNOME.
    Thanks to user wlan0 for the suggestion

    Simply open a terminal and type the following:
    Code:
    ln -s /usr/sbin/gdm3 /usr/sbin/startx
    Now, rather than using gdm3 to start gnome, you'd use 'startx'.
    Last edited by testingresults; 2013-05-19 at 01:11. Reason: Added more efficient method

  2. #2
    Join Date
    2013-Mar
    Posts
    6
    cp /usr/bin/gdm3 /usr/bin/startx
    You can command startx . Like backtrack

  3. #3
    I'm not being wise *** here at all, but why not just boot into run level 3 then when you want to go into the GUI change to 5?

    Thx
    Kali Linux Tools

  4. #4
    Quote Originally Posted by jerichodotm View Post
    I'm not being wise *** here at all, but why not just boot into run level 3 then when you want to go into the GUI change to 5?

    Thx

    Have you actually checked the runlevels on the default build of Kali?

    I haven't changed mine, but after quickly glancing at the relevant directories, I don't believe this would accomplish the same thing.

  5. Alternatively, you can also apt-get install sysv-rc-conf, run it, and uncheck gdm.

  6. #6
    Quote Originally Posted by wlan0 View Post
    You can command startx . Like backtrack
    It's acutally located in /usr/sbin, but I actually did this after reading your comment.

    Typing startx is more natural to me. Plus, it can be done using only one hand!

  7. #7
    Quote Originally Posted by superkojiman View Post
    Alternatively, you can also apt-get install sysv-rc-conf, run it, and uncheck gdm.
    Doing this will still require you to login twice on the occasions you decide to use gnome.

    Neither "alternative" suggested in this thread accomplishes the same thing.

  8. #8
    Join Date
    2013-Mar
    Location
    n0wh3r3
    Posts
    53
    this way you have to give usename and password twice. Once in command line and second time when you start gdm3. i want the same way like BT R3 login via command line and startx....... game on..... anybody knows how to??????

  9. #9
    Quote Originally Posted by Hitman View Post
    this way you have to give usename and password twice. Once in command line and second time when you start gdm3. i want the same way like BT R3 login via command line and startx....... game on..... anybody knows how to??????
    Do it the way I have it in the the initial post. If you edit the daemon as shown in Step 2, you'll only have to login once. I've added the additional, optional Step 3 to use classic startx to run gnome.

  10. #10
    Join Date
    2013-Mar
    Location
    n0wh3r3
    Posts
    53
    Quote Originally Posted by testingresults View Post
    Do it the way I have it in the the initial post. If you edit the daemon as shown in Step 2, you'll only have to login once. I've added the additional, optional Step 3 to use classic startx to run gnome.
    Man my /etc/gdm3/daemon.conf file already (default) having this code
    [daemon]
    # Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin = root

    now what to change in it its already the same that you described. I have to login twice one time in terminal and one time graphical do you have any other solution for it???

  11. #11
    Join Date
    2013-Mar
    Location
    n0wh3r3
    Posts
    53
    ooopss sorry guys i forgot to remove the # in the begining its working 100%

  12. #12
    Join Date
    2013-Apr
    Posts
    1
    Thanks for the write up. It works great, I like going into the text mode like BT. Noob question but how do you leave the gui back into text mode without shutting down? I didn't create the symbolic link so I use gdm3 to start instead of the startx. Thx.

  13. #13
    Quote Originally Posted by Hitman View Post
    ooopss sorry guys i forgot to remove the # in the begining its working 100%

    No big deal, we all make mistakes.

    Would you mind editing your first post to include this, though? A lot of users don't go past the first page.

  14. #14
    Quote Originally Posted by torque View Post
    Thanks for the write up. It works great, I like going into the text mode like BT. Noob question but how do you leave the gui back into text mode without shutting down? I didn't create the symbolic link so I use gdm3 to start instead of the startx. Thx.

    You're welcome.

    Easiest way to get back to command line from gnome would be using 2 sets of key cominbations.

    Code:
    First press: "Ctrl+Alt+F1"
    Then, press: "Ctrl+C"
    The first one will tab the screen back to the command line window; the second one will send a INT signal to the currently running process from that instance of bash (in this case, gnome).

    Hope that works for you.
    Last edited by testingresults; 2013-04-13 at 06:52.

  15. #15
    Join Date
    2013-Mar
    Location
    Totally lost
    Posts
    45
    it can be done using only one hand!
    What are you doing with your other hand?

  16. #16
    Quote Originally Posted by Vulpi View Post
    What are you doing with your other hand?
    Need my right hand free to reach |

  17. #17
    Join Date
    2013-Mar
    Location
    Totally lost
    Posts
    45
    Quote Originally Posted by testingresults View Post
    Need my right hand free to reach |
    More fun than eating pizza!

  18. #18
    If you want a quick copy/paste method:
    Code:
    cp -n /etc/X11/default-display-manager{,.bkup}
    echo > /etc/X11/default-display-manager
    cp -n /etc/gdm3/daemon.conf{,.bkup}
    sed -i 's/^.*AutomaticLoginEnable = .*/AutomaticLoginEnable = True/' /etc/gdm3/daemon.conf
    sed -i 's/^.*AutomaticLogin = .*/AutomaticLogin = root/' /etc/gdm3/daemon.conf
    ln -s /usr/sbin/gdm3 /usr/bin/startx   # Old school ;)

  19. #19
    Quote Originally Posted by g0tmi1k View Post
    If you want a quick copy/paste method:
    Code:
    cp -n /etc/X11/default-display-manager{,.bkup}
    echo > /etc/X11/default-display-manager
    cp -n /etc/gdm3/daemon.conf{,.bkup}
    sed -i 's/^.*AutomaticLoginEnable = .*/AutomaticLoginEnable = True/' /etc/gdm3/daemon.conf
    sed -i 's/^.*AutomaticLogin = .*/AutomaticLogin = root/' /etc/gdm3/daemon.conf
    ln -s /usr/sbin/gdm3 /usr/bin/startx   # Old school ;)

    Wow, very efficient! I like...
    Mind if include this in the initial post?
    Last edited by testingresults; 2013-05-19 at 01:09. Reason: Went ahead and added it -- assumed you wouldn't mind. Let me know if otherwise.
    Clever girl!

  20. #20
    Quote Originally Posted by testingresults View Post
    Wow, very efficient! I like...
    Mind if include this in the initial post?
    Not at all! Please, go ahead and share it wherever =)

    Thanks for making the original post - I know a couple of people have been asking for this!
    Last edited by g0tmi1k; 2013-05-19 at 09:54.

  21. #21
    some1learning Guest
    ty 4 sharing! big help!

  22. #22
    Join Date
    2013-Jun
    Posts
    3
    I am noob, if my question is irrelevant then please don't mind.
    I have created a regular user in my kali installation. I use is for day to day tasks and login as root when i learn pentesting.

    I want to know a thing, in daemon.conf if i set AutomaticLogin=root then xsession will run as root user even if i login as non-root user.
    If i set it to non-root user then possibly (i do not know) it will not work well when i login as root

    Is there any way to start xsession with the credentials of logged-in user?

  23. #23
    Join Date
    2013-May
    Posts
    4
    I seriously cant believe we are going through all this for something simple that can be achieved through sysv-rc-conf, xinit, .bash_login and .xinitrc files!

  24. #24
    Join Date
    2013-Jun
    Posts
    3
    Here is want i did to achieve the same.

    # chkconfig gdm3 remove

    Restarted, login at console, then
    # startx

    But only the problem i see is, when i login as non-root user xfce session disable restart and shutdown buttons.
    However if i login as root then everything is fine.

  25. #25
    Quote Originally Posted by Z1gn@l View Post
    I seriously cant believe we are going through all this for something simple that can be achieved through sysv-rc-conf, xinit, .bash_login and .xinitrc files!
    I fail to see how copying 6 short lines of code and pasting it into a terminal qualifies as "all this."

    I suppose everything is subjective though...
    Last edited by testingresults; 2013-06-06 at 01:01.
    Clever girl!

  26. #26
    Join Date
    2013-Jul
    Posts
    1
    This is easier to me, but I'm open to suggestions or issues -

    ls /etc/rc2.d/*
    Now look at the file output for an xwin display manager starting up via 'S' at the beginning of the filename to start the service. In my case, it was /etc/rc2.d/S17gdm3. In my case, to stop or kill Xwindow at default runlevel 2, I just did this:

    cp /etc/rc2.d/S17gdm3 /etc/rc2.d/S17gdm3.bak #safe keeping
    mv /etc/rc2.d/S17gdm3 /etc/rc2.d/K17gdm3 # 'K' to kill sevice
    reboot

    The original idea is also very informative and useful to know.

  27. #27
    Quote Originally Posted by kennedypj View Post
    This is easier to me, but I'm open to suggestions or issues -

    ls /etc/rc2.d/*
    Now look at the file output for an xwin display manager starting up via 'S' at the beginning of the filename to start the service. In my case, it was /etc/rc2.d/S17gdm3. In my case, to stop or kill Xwindow at default runlevel 2, I just did this:

    cp /etc/rc2.d/S17gdm3 /etc/rc2.d/S17gdm3.bak #safe keeping
    mv /etc/rc2.d/S17gdm3 /etc/rc2.d/K17gdm3 # 'K' to kill sevice
    reboot

    The original idea is also very informative and useful to know.

    Won't you still have to login twice using this method (in the instance of using gdm)?
    Clever girl!

  28. #28
    Join Date
    2013-Oct
    Posts
    1
    You cannot lock the system doing this way as it would be easy to crack and get into the root or any account by just a combination of Ctrl+Alt+F1 and a Ctrl+C after that..
    Isn;t that correct ?? or am i missing somehting

  29. #29
    Quote Originally Posted by arjunvs View Post
    You cannot lock the system doing this way as it would be easy to crack and get into the root or any account by just a combination of Ctrl+Alt+F1 and a Ctrl+C after that..
    Isn;t that correct ?? or am i missing somehting
    How so? You wouldn't be logged in automatically after starting up.
    Clever girl!

  30. #30
    Use with caution. This seems to be causing startup problems with Kali's new configuration.
    Clever girl!

Similar Threads

  1. Replies: 0
    Last Post: 2020-12-19, 20:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •