Can login kali linux

Can login kali linux

There are some cases where you may need to use superuser, root, for an extended period of time. In these cases we can easily access the root account with a simple sudo su (which will ask for the current user’s password), selecting the root terminal icon in the Kali menu, or alternatively using su — (which will ask for the root user’s password) if you have set a password for the root account that you know of. When finished, exit or CTRL+D will take us out of this elevated shell.

However, there may be other times where you may want to use root across multiple sessions without the hassle of elevating privileges. In these situations we will need to install a package and make a few modifications to fully enable the root account for use due to security reasons of keeping the root account disabled by default.

Enabling the root account

The first thing to do is set a root password, which should be different to the current user’s password (in this case kali ). We can do this by doing the following:

[email protected]:~$ sudo passwd [sudo] password for kali: New password: Retype new password: passwd: password updated successfully [email protected]:~$ 

Please note that the password prompt will not display output as you are typing in the password, but it will still register the keystrokes.

The next thing we need to decide is if we are wanting to use root via SSH or through the login prompt on whichever desktop environment is installed.

Enabling root for SSH

If we look at /etc/ssh/sshd_config we will see a PermitRootLogin line. We will want to change this line to match our use case:

[email protected]:~$ grep PermitRootLogin /etc/ssh/sshd_config #PermitRootLogin prohibit-password # the setting of "PermitRootLogin without-password". [email protected]:~$ [email protected]:~$ man sshd_config | grep -C 1 prohibit-password PermitRootLogin Specifies whether root can log in using ssh(1). The argument must be yes, prohibit-password, forced-commands-only, or no. The default is prohibit-password. If this option is set to prohibit-password (or its deprecated alias, without-password), password and keyboard-interactive authentication are disabled for root. [email protected]:~$ [email protected]:~$ sudo systemctl restart ssh [email protected]:~$ 

If we have set up SSH key based login for the root account, then we can simply uncomment the appropriate line and continue on. Otherwise, we should change PermitRootLogin to be yes which will allow us to input a password.

Enabling root for GNOME and KDE login

We will first install kali-root-login to change multiple configuration files that will permit us to login to the root account through the GNOME GDM3 and the KDE login prompt. This step is not necessary when using other desktop environments:

[email protected]:~$ sudo apt -y install kali-root-login Reading package lists. Done Building dependency tree Reading state information. Done The following NEW packages will be installed: kali-root-login 0 upgraded, 1 newly installed, 0 to remove and 1516 not upgraded. Need to get 6,776 B of archives. After this operation, 33.8 kB of additional disk space will be used. Get:1 http://kali.download/kali kali-rolling/main amd64 kali-root-login all 2019.4.0 [6,776 B] Fetched 6,776 B in 1s (10.9 kB/s) Selecting previously unselected package kali-root-login. (Reading database . 333464 files and directories currently installed.) Preparing to unpack . /kali-root-login_2019.4.0_all.deb . Adding 'diversion of /etc/gdm3/daemon.conf to /etc/gdm3/daemon.conf.original by kali-root-login' Adding 'diversion of /etc/pam.d/gdm-password to /etc/pam.d/gdm-password.original by kali-root-login' Adding 'diversion of /etc/pam.d/gdm-autologin to /etc/pam.d/gdm-autologin.original by kali-root-login' Adding 'diversion of /etc/pam.d/lightdm-autologin to /etc/pam.d/lightdm-autologin.original by kali-root-login' Adding 'diversion of /etc/pam.d/sddm to /etc/pam.d/sddm.original by kali-root-login' Adding 'diversion of /etc/sddm.conf to /etc/sddm.conf.original by kali-root-login' Unpacking kali-root-login (2019.4.0) . Setting up kali-root-login (2019.4.0) . Installing /usr/share/kali-root-login/daemon.conf as /etc/gdm3/daemon.conf Installing /usr/share/kali-root-login/gdm-password as /etc/pam.d/gdm-password Installing /usr/share/kali-root-login/gdm-autologin as /etc/pam.d/gdm-autologin Installing /usr/share/kali-root-login/lightdm-autologin as /etc/pam.d/lightdm-autologin Installing /usr/share/kali-root-login/sddm as /etc/pam.d/sddm Installing /usr/share/kali-root-login/sddm.conf as /etc/sddm.conf [email protected]:~$ 

We can now log out of our non-root user account and login to root using the password that we set earlier.

Читайте также:  Работа с txt linux

Updated on: 2023-Mar-06
Author: gamb1t

Источник

Can’t login in Kali Linux

I installed Kali Linux a month ago. It was good until today. When I submit username and password the box disappears and reappears again asking about username and password. It shows no error. I just can’t login. I also tried to make new account and try login but same problem occur. I don’t wanna reinstall it.

Since it doesn’t show an error, it’s probably not a problem with the account. I suspect that there is an error with whatever desktop environment/window manager is started. Can you use ++ to switch to a console and login there? It might be useful to look for errors in ~/.xsession-errors and /var/log/Xorg.0.log

If you have reason to believe your installation of Kali Linux was compromised, as is the case here, you really have to reinstall it from a known-good source.

Recently I have this login problem while run Kali on Virtual Box. It turn out that I was out of space on virtual disc drive. When I remove some files, that I have there I was able to log in like always.You can enter tty from Virtual Box using your hot key — default is your Right Ctrl and F1. If you want to exit from tty to GUI use Right Ctrl and F7.

8 Answers 8

I saw this post on a quest for a solution to the same problem. I couldn’t find an answer. What i then tried doing was this and it worked.

  1. While in the username screen press Ctrl + Alt + F1
  2. Login with root.
  3. Type sudo apt-get update
  4. Type sudo apt-get upgrade
  5. Type sudo reboot

After that the system rebooted and the login worked! I hope this works for who ever finds this post.

This seems to happen when a lot of updates are run. It happened to me when using the 2016.2 OVA and running a full update and upgrade. Here are the steps that worked:

Читайте также:  Linux command all running processes

This will finish the updates that were interrupted.

If all those precious answers fail, drop in a tty using Ctrl + Alt + F3 or any other Function key and login. Now, create a directory first with mkdir -p ~/dotfiles_backup . Then, execute the following command:

find ~ -name '.*' -maxdepth 1 -type f -exec mv <> ~/_dotfiles_backup/ \; 

If after this you’re still unable to login, run it again but remove the -type f option. If you get Operation not permitted or Permission denied, use sudo.

This will reset most of your saved preferences. After you’re able to login again, you can try to restore them one by one and see what was causing the problem.

Источник

How To Get root Access and root Account Login into Kali Linux 2020.1

how_to_root_password_kali_linux

The default user in Backtrack is the root and after the Backtrack name changed into Kali Linux policy remain the same default name is the root where user login with root by default. But now Kali changes their policy and come to traditional default non-root user model and introduced in the latest version of Kali Linux 2020.1. The live mode of Kali Linux will be running as a user kali password kali. No more root/toor. While we install the Kali Linux at that time we will create a non-root user that will have administrative privileges (due to its addition to the sudo group). This is the same process as other Linux distros have.

How To Get root Access:

In Kali Linux 2020.1 by default we login as non-root users and there we have to set the root password by our self. The first time we don’t know the root password so we can not login directly that why we have to login as non-user which is created while we install Kali Linux 2020.1.

Check login user

Now, first of all, you have to open the terminal and you can check currently login user with the help com whoami command.

whoamiLogin as root in the terminal

Now we to switch the user non-root to root so you have to type the command in terminal as sudo -i and hit enter.

sudo_i

Check the root login or not?

Now you can check you are in the root you can identify with the symbol of as well as you can type the same command whoami.

sudo_i_whoami

Set the Kali Linux root password

Now you have verified the current login user in the terminal is root so you have to type passwd command and hit enter, it is asking for a password so you have to enter the password and then verify the password, and that it, you have set the root password using the terminal.

root_password_kali_linux

Login as root in Kali Linux

Now you can exit from root user and close the terminal and logout from non-root user and login with root user with the help of a new password.

That’s it this is the way how you can change the root password and login with root user.

Читайте также:  Редактор pdf файлов linux

Video

You can watch the following video where I show step by step how you can get root access and how you can change the password.

How To Get root Access in Kali Linux GNOME Desktop Environment

In the GNOME DE, we have to get root access following the all above steps. But in the GNOME DE we have to follow an extra step which is we have to edit a file and in the file. We have to comment a line to logging in as root in Kali Linux 2020.1 with GNOME Desktop Environment.

# sudo nano /etc/pam.d/gdm-password

How To Get root Access in Kali Linux

In this file we have to comment on the second line: auth required pam_succeed_if.so user != root quiet_success

#%PAM-1.0 auth requisite pam_nologin.so #auth required pam_succeed_if.so user != root quiet_success @include common-auth auth optional pam_gnome_keyring.so @include common-account # SELinux needs to be the first session rule. This ensures that any # lingering context has been cleared. Without this it is possible # that a module could execute code in the wrong domain. session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so close session required pam_loginuid.so # SELinux needs to intervene at login time to ensure that the process # starts in the proper default security context. Only sessions which are # intended to run in the user's context should be run after this. # pam_selinux.so changes the SELinux context of the used TTY and configures # SELinux in order to transition to the user context with the next execve() # call. session [success=ok ignore=ignore module_unknown=ignore default=bad] pam_selinux.so open session optional pam_keyinit.so force revoke session required pam_limits.so session required pam_env.so readenv=1 session required pam_env.so readenv=1 envfile=/etc/default/locale @include common-session session optional pam_gnome_keyring.so auto_start @include common-password

How To Get root Access in Kali Linux

Video

You can watch the following video where I show step by step ho you can get root access in Kali Linux and how you can change the password and log in as root in Kali Linux with GNOME Desktop Environment.

Important Things To Remember:

The author of this article does not promote any illegal activities It is just for education purpose All the activities provided in this article, YouTube channel, and on the website techdhee.in are only for educational purposes.

If you are using and follow this tutorial for any illegal purpose, techdhee.in can not be responsible for your action.

My purpose is to educate or share information that have not. How to secure your self from the Internet, and the world of digital.

Finally

Thank you for reading this post and keep connected to TECH DHEE to continue enjoying excellent posts. Share your views about this post in the comment section below. If you still have any queries, throw it in the comment section. If you find this post helpful, don’t hesitate to share this post on your social network. It will only take a moment, and also it is quite easy and useful for others.

TECH DHEE

A geek by passion! I started my career as a Network Engineer and currently, I am working as a Network & Systems Administrator. It was probably the most fun I’ve ever had in a job. I felt like a magician and got to see the good side of people.

Источник

Оцените статью
Adblock
detector