How to add remove user (standard user/non-root) in Kali Linux?

Login as new user

  • Once logged in, let’s confirm from command line who I really am! In terminal type in the following
    whoami

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -9

    Take note of user1@kali prompt. That also confirms who you are.

  • And let’s check my group affinity, type in the following in terminal:
    groups

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -10

    Looks good to me so far.

    I am part of user1 group (my primary) and sudo group. That means I can run privileged commands or just become root myself if required.

  • Become root!
    sudo su –

    and type in user1’s password to become root.

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -11

    See the prompt becomes root@kali instead of user1@kali. That means you’re now root and get to run anything Kali got to offer.

  • Lets confirm that using whoami command
    whoami

    How to add remove user - Standard usernon-root - in Kali Linux - blackMORE Ops -12

    So far so good. Now how do you delete a user?

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 …

How to fix You can’t access this shared folder because your organization’s security policies block unauthenticated guest access error on Windows 11

If you have the following error on Windows 11 “You can’t access this shared folder …

51 comments

  1. Thank you very much! Was reading some stuff about this ICEAuthority error but this helped me finally! Great Template of the Blog by the way.

    John

  2. Awesome for nebie like me. Nebie question. Why you change default shell?! What for?!

    • Hi olmc,

      Thanks. I’m glad you actually picked it up and paid attention to small details.

      bash is a superset of sh ie. everything you can do in sh you can do in bash. Bash has more features (branching, builtins, arrays) making script easier to write. I guess Wikipedia can explain better than I can .. http://en.wikipedia.org/wiki/Comparison_of_comput…. You could create another user, skip chsh -s /bin/bash user1 and see how default shell feels like. If you like that, you keep that, else you could always delete that test user.

      • in my experience doing this caused ALLOOOOOT of problems with path $secure /usr/bin/bash..it did not let me install in root and or sudo user..a complete mess be warned

  3. Is the command sudo su – permenant because it keeps reverting back to user?

  4. I used to log in as root ! but now i’ m standard user !
    so how can i import all the system settings and preferences from the old user (root) to this new user ?
    and thank you !

    • I have been trying to find the same answer as Helmi??? Bump

      • There’s no easy answer to this really. Ideally you should be making changes on /etc/skel/ so that the changes takes affect when a new user is created.
        Apart from that, copy all files from User1 to User2 home folder, chmod and chown them. But depending on applications installed and access required, I am afraid you’ll be doing too much work this way. Cheers,
        -BMO

  5. great work

  6. Very insightful and informative….

    THanks

  7. Thank’s to the communities of blackmoreops you are just doing a marvellous job.

  8. I tried to do this just to access chrome, and I think changing the default shell on the new user somehow killed gnome3.

    Now when I boot in, I just have a black screen with the cursor as a white watch. I can access the terminal, but can’t seem to get internet access, and nothing I can find anywhere else seems to help.

    Any ideas? I tried changing the shell on root between sh and bash, with no luck. Deleting the user, trying to fix the apt-get installs via net but couldn’t connect.

    Thank you very much for your guides otherwise though! They’re fantastic.

  9. Hello admin please help me can u tell me how to switch users in Kali Linux on android

  10. Hi,
    I followed ur steps.. works fine till add to SUDO group. Next when I do the chsh -s /bin/bash username, I get a “enter password” and then authentication failure. (I enter root password. I also tried the username password and no password !) I am working with Kali linux.

    Am I missing anything?

    Thank you for the time.

  11. plz help
    How to remove my login detail from wtmp

  12. hi
    thank you for this great tutorial
    but i have i small problem i hope you help me solving it
    i can normally log in as root but when i try log in as normal user this message shows up ” could not update iceauthority file /home/habi/.ICEauthority

    i tried to remove the file but it didn’t work .
    thank you very much.

  13. How to change the “root” name?

  14. i got a error to create a useradd -m user1 this commd,can not create direcetory home/user1

  15. Thanks for the great post!

  16. Awesome
    it really works.
    i have changed user name by using above commands in recovery mode

  17. i shall now proceed to bookmark your page

  18. Very Helpful. Thanks.

  19. How do we safely delete group created by user1, assuming that a group ‘user1’ created for user ‘user1’.

  20. just getting an error at the first command ”uname: extra operand ‘–a’
    Try ‘uname –help’ for more information.”

  21. hello sir
    I got an error . when i updated my kali linux to kali linux rolling , i had an account in kali linux with name “ali” and unfortunately it had been deleted but now when i tried to log in into kali linux rolling the CLI shows an error with user “ali” services not started and all the extensions has been stopped . so kindly tell me what can i do ..
    i also tired by deleting the home dir of user ali but not worked .

  22. to change from normal to root user type in sudo -i
    then a window will pop up asking for pass
    then type the user password
    you are ready to go
    if it doesnt work try switching to genome in the logout page

  23. Please find need help, after entering user name I try to type my new password is does not do anything, I don’t know what I am doing wrong here please help?

  24. Not working in the ‘new’ rolling version of Kali 2.0 (after distupgrade)

    For some reason it stays ‘root’

    Tried it over and over what you wrote, but it won’t work.

    Am I doing something wrong?

    Ok, Kali 2.0 is on a fast USB stick here, works fine so far.

    But I can’t make another user, passwd, sudo …

    Greets,

    Pete

    • Hello Pete,
      Are you using non-persistent USB installation? This works on pretty much any Debian flavored distro. What is the error you are getting?
      You can try this …

      useradd -m mytestuser -G sudo -s /bin/bash
      passwd mytestuser
      Enter new UNIX password: somepassword1234
      Retype new UNIX password: somepassword1234
      su bmo

      This should create and then switch to mytestuser account.
      -BMO

      • Hello -BMO

        Tnx for your reply.

        I’ve made one with persistence.

        These are the changes I’ve made in the daemon.conf

        daemon]

        Enabling automatic login
        AutomaticLoginEnable = true
        AutomaticLogin= user1

        Enabling timed login
        TimedLoginEnable=true
        TimedLogin= user1
        TimedLoginDelay= 10

        Reserving more VTs for test consoles (default is 7)
        FirstVT=9

        [security]
        AllowRoot=true

        [xdmcp]

        [chooser]

        [debug]
        More verbose logs
        Additionally lets the X server dump core if it crashes
        Enable=true

        ==
        User1 I have made like you from BMO wrote.

        At the moment It’s working.

        I can easily change root and user1, the window pops up now.

        Maybe it’s not the right way but I’m a n00b you know.

        Greetings Pete and tnx.

  25. Hellow there,

    First I have to thank you for the fast reply.

    I tried it out but it doesn’t work.

    I’ve set up the USB 3.0 stick this way.

    Downloaded a Kali 2.0 installed it on the bootable stick with ‘Pendrivelinux’

    After installing Kali on the stick I’ve set up it as Persistence (Mini Partition Tool) to move/resise the usb stick.

    You can shrink the partition size with the Mini partition Tool. I thought you needed that when making changes to the OS??? (space?)

    create as: Primary … File system: Ext 4 … partition label: persistence

    Done that I had to set up ‘persitence’

    fdisk -l (L)
    (do remember partition you have created on: fat32,NTFS, exFAT, Ext4)

    mkdir -p /mnt/UUI
    mount /dev/sdb2 /mnt/UUI
    echo “/ union” > /mnt/UUI/persistence.conf
    umount /dev/sdb2 && reboot

    Worked fine after reboot, dit the apt-get clean/update/upgrade/dist-upgrade

    Build in some things as TOR, LibreOffice, VLC-player, Hexchat, Angry IP scanner searched the net for those things. :s

    Then I wanted to make another user and that didn’t work.

    Have I messed up the OS?

    If I do what you wrote the only thing it does is that in the ‘All settings window -Users the name (you gave: ‘mytestuser’) i gave the new user is in it but I can’t make changes on it and ne user won’t run. As I click the name of the new user in Users it must be possible to make some more settings but I didn’t do it)

    As you see, I’m not an IT but I do loved the Kali 2,0 distro. There are many Linux distros but I think they ar not that good.

    I want to give it another try … dunno what went wrong???

    Thank u again for your reply.

    Greets,

    Pete

    p.s. sorry for the msitypo’s

  26. Surfing and searching all over the net for some ‘goodies’ I noticed this:

    http://null-byte.wonderhowto.com/how-to/install-kali-live-usb-drive-with-persistence-optional-0162253

    I’ve searched it all myself but its a very very good text from the ‘NullByters’

    I think while I was installing it that way, I’ve forgot something and that was the ‘sudo’ command.

    But anyway, it’s running like a charm.

    I do believe Kali (Debian) is the best Linux Distro there ever was.

    Greets to ya all folks, keep up the good work,

    Pete

  27. THx . very use full information

  28. I am using kali 2016.2 e17 version and I set up a standard user but when trying to login I get a enlightenment crash and all modules shutdown error right after language,keyboard,profile picks. Any ideas.
    I deleted user through root login and setup again same thing.

    • I am using kali 2016.2 e17 version and I set up a standard user but when trying to login I get a enlightenment crash and all modules shutdown error right after language,keyboard,profile picks. Any ideas.
      I deleted user through root login and setup again same thing.
      I am also using this on Virtualbox

  29. It’s so helpful my friend. Thank you very much.

    The details of your posts are the bests, I can learn a lot of things with it

    Best Regards

  30. Hello,

    I have changed the last kali software it’s daemon.conf an at the moment everything is working like a charm.

    The window where I can change root and user1 is back!!

    Greets.

  31. Hello BMO fans.

    I made a mistake while installing Kali 2.0 64bit!!! on a USB 3.0 stick. Used an ‘old’ PC. (I’ve tried to install the 64bit with pendrive and that didn’t work on my ‘old’ pc.

    Most of you ppl use ‘Pendrive Linux’ to make the installation.

    I think, for the latest versions of Kali OS software Pendrive is not that good so I tried an other one called ‘Rufus.’

    Latest new mobo’s are UEFI and in Rufus you can set Bios or Uefi & Bios or Uefi I thought.

    Installation is not that hard to do with Rufus and it didn’t made a problem.

    Rufus stops installing and downloads some files you need to make a clean installation of Kali.

    After installation make a persistence with ‘Mini Partition Tool’

    persistence
    primary
    Ext4

    If you give the Kali OS full space, there is no more room for the downloads/updates/upgrades so do make use persistence.

    Boot your Kali. As you see you are Root.

    Then you can make an User1 if you want to. How to do that is perfectly shown how to do that on the start of this page. (Tnx BMO)

    After you’ve done all the work (grin) log out and a ‘problem’ showed up, you can’t login as User1 because the window where to set User1’s name and passw didn’t show up.

    As I wrote a little bit higher up on this page ‘problem is something in the ‘daemon.conf’ file.

    Take ‘Terminal’ and type: Leafpad /etc/gdm3/daemon.conf (if you use of ‘gdm3’) and change the daemo.conf in:

    [daemon]

    Enabling automatic login
    AutomaticLoginEnable = true
    AutomaticLogin= user1

    Enabling timed login
    TimedLoginEnable=true
    TimedLogin= user1
    TimedLoginDelay= 10

    Reserving more VTs for test consoles (default is 7)
    FirstVT=9

    [security]
    AllowRoot=true

    [xdmcp]

    [chooser]

    [debug]
    More verbose logs
    Additionally lets the X server dump core if it crashes
    Enable=true

    Reboot and you’ll see the window where you can change to User1 is Alive again.

    I don’t know if I am doing this right because I am not an IT and I don’t know lot’s about Linux but anyway for me it works and the Latest Kali version 64Bit is running very fast on that USB3.0 stick.

    Greets to everybody, Pete

    Keep up the good work BMO!!

    p.s. maybe I am doing it wrong but it works for me.

  32. Install graphical tools then use the command line, anyway. Brilliant.

  33. Hi there, You’ve done an excellent job. I’ll definitely digg it and personally suggest to my friends. I am confident they’ll be benefited from this web site.

  34. F*ckin?remarkable things here. I am very glad to see your post. Thanks a lot and i am looking forward to contact you. Will you kindly drop me a e-mail?

  35. Great web site. A lot of helpful info here. I sending it to some pals ans also sharing in delicious. And of course, thanks in your sweat!

  36. When I do chsh – s /bin/bash user1
    It asks me for password.I tried my root password and my user1 password but it gives me an error saying …..

    chsh: PAM: Aunthentication failure

    Please Help Me Out

  37. wouldn’t you also add the new user to the sudoers list?

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.