Kali linux admin user

How to provide root privileges to users on Kali Linux?

In Kali Linux, many commands and tools require root permission to run. However, we can run these commands by prefacing them with the sudo command. But, adding sudo to every command we use and entering the password every time, is quite frustrating.

Also, if there are a number of users, we need to provide them root privileges as most of the commands require root. In the current version of Kali Linux, root login is disabled by default though it also provides an easy option to re-enable root login. Let’s discuss in detail how to add new users and provide root privileges to users on Kali Linux.

Add new user in Kali Linux

We can add users in kali by using the adduser command. The adduser command is similar to useradd command. But, adduser command is more user-friendly than the useradd. It also creates folders, and directories while adding a new user while the useradd command doesn’t.

To add new users, You have to log in as root. Open a terminal window by pressing Ctrl+Alt+T and execute the following command to login as root:

root-privileges-1

Now, we will add user user1 to a group named user1. It will ask for the password and other information such as Full name, Room number, work phone, home phone, etc which are optional. Execute the following command to add a new user:

adduser --home /home/user1 user1

root-privileges-2

The above command will add a user user1 with group user1 by creating a directory /home/user1.

Grant root privileges to users

To give root permissions to users, We can do so either by installing the kali-grant-root package or by editing the /etc/passwd file. By granting root privileges, the user will be able to use the sudo command without entering the password.

Add user to the root group

To add users to the root group, We will use the usermod command. Run the following command in a terminal window:

sudo usermod -a -G root user1

root-privileges-3

This will grant root privileges to the above user.

Install the kali-grant-root package

First, Update the system repositories by executing the following command:

root-privileges-4

Now, install the package kali-grant-root by executing the following command:

sudo apt install kali-grant-root

root-privileges-5

Configure the above-installed package by running the following command:

sudo dpkg-reconfigure kali-grant-root

root-privileges-6

You will be provided with a list of options that decides whether to add a user to the kali-trusted group. Select ‘Enable password-less privilege escalation’ from the options to continue. This will add the user to the kali-trusted group.

Now, log out and re-login, and update the repositories. After the update, try any command that requires root permissions. If the above method is successful, You will not be prompted for the password.

Читайте также:  Linux tar unpack directory

Delete a user with root privileges

If you want to delete an existing user with root privileges granted, you can do so by executing the following command:

sudo deluser --remove-home user1

root-privileges-7

The above command will remove the user user1 along with its directory.

Conclusion

So, We covered adding a new user, granting root privileges using different methods, and deleting a user. When there are several users accessing a system, It is mandatory to manage the root permissions. Using the above methods, You can check on the user’s activity and also any intruding activity. I hope it works for you. Thank you for reading!

Источник

Kali linux admin user

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.

Читайте также:  Linux few commands in one line

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.

Updated on: 2023-Mar-06
Author: gamb1t

Источник

Kali linux admin user

Как зайти под root в Kali Linux 2020.1?

Zip File, мои юные хацкеры. Нынче мы затронем насущную тему работы с правами root-пользователя в Kali Linux 2020. Одним из нововведением этой версии является механизм работы no-root. Т.е. по умолчанию, после установки или на готовой виртуалке вы работаете из-под обычного смертного юзверя. Это сделано сугубо из соображений безопасности. Ведь если использовать Kali’шку в качестве основной декстопной оси, постоянно сёрфить в дарке и периодически баловаться с инструментами пентестинга, вероятность однажды самому предстать в роли жертвы возрастает в разы.

Однако, если вы запускаете её изредка, используете исключительно в образовательных целях и изолируете от основной сети, максимально минимизируя уязвимость системы, вам будет гораздо удобнее сразу работать под root’ом.

Как минимум, это избавит вас от бесячих проблем забывания ввести «sudo» перед очередной командой, а как максимум, поможет не заморачиваться с отсутствием нужных прав при инсталляции того или иного пакета.

Сегодня, я покажу вам несколько вариантов, изучив которые, вы сможете повысить свою эффективность работы с системой Kali Linux и получить вожделенные рут-права. Устраивайтесь по удобнее и погнали чудить.

Шаг 1. Если не поняли из предисловия о чём идёт речь, покажу на практике. Вводим знакомую всем линуксоидам команду для обновления списка пакетов apt-getupdate и видим ошибку «permission denied», означающую отсутствие соответствующих прав.

root v kali linux 2020 1

Шаг 2. А теперь повторяем команду введя перед телом «sudo». Апдейт сразу завёлся. Всё потому, что приставка sudo позволяет выполнять нам любую команду с неограниченными правами супер-пользователя.

Читайте также:  Открыть boot img linux

root v kali linux 2020 2

Шаг 3. А наш текущий, таковым, к сожалению, не является. В этом можно убедиться, введя id. Видите, юайди – тысяча. Это говорит нам о том, что перед нами самый обычный пользюк.

root v kali linux 2020 3

Шаг 4. Для того, чтобы работать в окне терминала с правами рута, достаточно ввести простенькую команду «sudo su».

root v kali linux 2020 4

Шаг 5. Давайте теперь проверим юайди. Он упал до нуля, а следовательно мы сто пудово работаем с неограниченными правами. Имя пользователя, как видите, тоже изменилось.

root v kali linux 2020 5

Шаг 6. Однако согласитесь, что в плане безопасности этот способ переключения на рута, совсем уж топорный. Давайте хотя бы, для приличия, пароль установим. Sudo passwd. И дважды вводим сложный пассворд. Окей. Теперь давайте закроем окно терминала.

root v kali linux 2020 6

Шаг 7. И открыв новое введём su. Система запрашиваем пароль, который мы только что задали для root-пользователя. Вводим его.

root v kali linux 2020 7

Шаг 8. Давайте попробуем теперь обновить список пакетов, не вводя предварительно sudo. Так. Всё работает. В принципе, работа в таком режиме является наиболее безопасной для тех, кто использует Кали в качестве основной оси. Но если вы пользуетесь ей редко и заинтересованы в экономии времени, можете сразу ломиться под рутом. Давайте попробуем это сделать. Выходим из системы.

root v kali linux 2020 8

Шаг 9. И вводим логин суперпользователя и пароль, установленный ранее. «Log In».

root v kali linux 2020 9

Шаг 10. После входа вызываем окно терминала и убеждаемся в своей крутости.

root v kali linux 2020 10

Таким образом, вы теперь сможете реально экономить своё драгоценное время, вводя все команды без обременительной приставки sudo. Работать сразу с полными правами гораздо приятней.

И практически, и просто морально. Вообще до 2020 года в Kali всегда изначально создавался Root-пользователь, а вышеописанные танцы с бубном — это прямо-таки ноу-хау от разработчиков.

Ну да ладно. Главное, что вопрос при желании, более чем решаемый. Друзья, если вы хотите более подробно узнать обо всех нюансах работы с пользовательскими учетными записями и группами, то я настоятельно рекомендую вам ознакомиться с моим обучающим курсом «Администрирование Linux с нуля».

В нём я подробнейшим образом разбираю вопросы администрирования самой популярной серверной операционной системы семейства Linux. К слову, в данный момент на курс действует 50% скидка. Ссылку со всеми подробностями оставлю в описании.

Обучающий курс «Администрирование Linux с нуля»

>>>КЛИКНИТЕ, ЧТОБЫ УЗНАТЬ ПОДРОБНОСТИ

На этом у меня всё. Сегодня урок не столько долгий, сколько полезный. Мне просто нужно затестить звук напрямую с рекордера. Жена сказала, что он гораздо лучше раскрывает мой голос, нежели петличка.

Так что, олды, напишите пожалуйста в комменты, богаче ли стало звучание, или всё-таки стоить вернуть петлю. Мне действительно важно знать ваше мнение. И не забываем про лайки, если видос оказался полезен.

На а те, кто впервые забрёл на канал, не тупите. Обязательно клацайте колокольчик. Нажмёте, и в вашей ленте будут регулярно появляться ролики на тему kali linux’а, практических взломов и пентестинга.

Традиционно желаю удачи, успехов, отличного настроения. Изучайте Linux, заботьтесь о безопасности и никогда не забывайте пароль от Root’а. Это самое стрёмное, что может случиться. Уж поверьте. До новых встреч, ребятки. Всем пока.

Источник

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