# How To Login as root in Kali Linux 2020.1 | Default and GNOME Desktop Environment

**URL:** <https://onehack.st/t/how-to-login-as-root-in-kali-linux-2020-1-default-and-gnome-desktop-environment/82683>\
**Category:** Tutorials & Methods\
**Tags:** operating-system\
**Created:** [April 27, 2020, 11:23am UTC](https://onehack.st/t/how-to-login-as-root-in-kali-linux-2020-1-default-and-gnome-desktop-environment/82683 "2020-04-27T11:23:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![OGLinux](https://onehack.st/user_avatar/onehack.st/oglinux/32/39916_2.png) [@OGLinux](https://onehack.st/u/OGLinux)\
**Post date:** [April 27, 2020, 11:23am UTC](https://onehack.st/t/how-to-login-as-root-in-kali-linux-2020-1-default-and-gnome-desktop-environment/82683/1 "2020-04-27T11:23:07Z")

</div>

The default use in Kali Linux is standers in latest version, so how you can enable root user login in it, so here I will gonna show how to log in as root in Kali Linux in both desktop environments default one as well as GNOME desktop environment.

- **Default Desktop Environment (XFCE)**

1. Log in as Normal User: First, you have to login as normal user, and then you have to open the terminal and type the following command:  
`sudo -i`

![](https://techdhee.in/wp-content/uploads/2020/04/sudo_i.jpg)

Now you are in the root you can type the command **whoami**. to verify you are in the root or not.’

![](https://techdhee.in/wp-content/uploads/2020/04/sudo_i_whoami.jpg)

### Set the [Kali Linux](https://techdhee.in/best-way-to-install-kali-linux-2020-1-on-virtual-box-step-by-step/) root password

now you have to set the root password using **passwd** command

![](https://techdhee.in/wp-content/uploads/2020/04/root_password_kali_linux.jpg)

## Now you can log in as root in Kali Linux

![](https://techdhee.in/wp-content/uploads/2020/04/root_login-min.gif)

- **GNOME Desktop Environment**

In GNOME desktop you have to follow the same above steps just in the DE you have to follow an extra step, you have to edit a file which is

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

![](https://techdhee.in/wp-content/uploads/2020/04/gdm-password-file.jpg)

in this file, you have to comment on the following line: `auth required pam_succeed_if.so user != root quiet_success`

![](https://techdhee.in/wp-content/uploads/2020/04/gdm-password-file-commente-line-1024x583.jpg)

Now you can login as root in GNOME Desktop Environment.

![](https://techdhee.in/wp-content/uploads/2020/04/How-To-Get-root-Access-in-GNOME-Desktop-Environment.gif)
