Users in kali linux

Как создать нового пользователя в Linux

Утилита useradd — регистрирует нового пользователя или изменяет информацию по умолчанию о новых пользователях

При вызове без опции -D команда useradd создаёт новую учётную запись пользователя, используя значения, указанные в командной строке, плюс значения по умолчанию из системы. В зависимости от параметров командной строки команда useradd обновит системные файлы, а также может создать домашний каталог нового пользователя и скопировать исходные файлы.

По умолчанию для нового пользователя также будет создана группа (смотрите опции -G, -N, -U и USERGROUPS_ENAB).

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

заканчиваться знаком доллара. Это можно описать регулярным выражением: [a-z_][a-z0-9_-]*[$]?

Имена пользователей могут быть длиной не более 32 знаков.

Как создать нового пользователя в Debian, Kali Linux, Linux Mint, Ubuntu

Для создания нового пользователя запустите команду вида:

Замените НОВЫЙ_ПОЛЬЗОВАТЕЛЬ на желаемое имя.

Установите пароль для нового пользователя:

Как создать нового пользователя в Arch Linux, Manjaro, BlackArch и их производных

Для создания нового пользователя с sudo (замените НОВЫЙ_ПОЛЬЗОВАТЕЛЬ на настоящее имя) выполните команду вида::

Установите пароль для созданного пользователя:

Опции команды useradd

Рассмотрим несколько важных опций утилиты useradd.

-s, —shell ОБОЛОЧКА

Имя оболочки входа пользователя. По умолчанию это поле остаётся пустым, в результате чего система выбирает оболочку входа по умолчанию, заданную переменной SHELL в /etc/default/useradd, или пустую строку по умолчанию.

-m, —create-home

Создать домашний каталог пользователя, если он не существует. Файлы и каталоги, содержащиеся в каталоге скелета (который может быть определён с помощью параметра -k), будут скопированы в домашний каталог.

По умолчанию, если этот параметр не указан и CREATE_HOME не включён, домашние каталоги не создаются.

-g, —gid GROUP

Имя или числовой идентификатор первичной группы пользователя. Группа с таким именем должна существовать. Идентификатор группы должен указывать на уже существующую группу.

Если не указано иное, поведение useradd будет зависеть от переменной USERGROUPS_ENAB в /etc/login.defs. Если для этой переменной задано значение «yes» (или в командной строке указано -U/—user-group), для пользователя будет создана группа с тем же именем, что и его имя для входа. Если для переменной задано значение no (или в командной строке указано -N/—no-user-group), useradd установит для первичной группы нового пользователя значение, указанное переменной GROUP в /etc/default/useradd или 100 по умолчанию.

-G, —groups GROUP1[,GROUP2,…[,GROUPN]]]

Список дополнительных групп, членом которых является пользователь. Каждая группа отделяется от следующей запятой без пробелов. На группы распространяются те же ограничения, что и на группу, указанную с параметром -g. По умолчанию пользователь принадлежит только к начальной группе.

-k, —skel SKEL_DIR

Скелетный каталог, содержащий файлы и каталоги, которые должны быть скопированы в домашний каталог пользователя, когда домашний каталог создаётся с помощью useradd.

Эта опция действительна, только если указана опция -m (или —create-home).

Если этот параметр не установлен, каталог скелета определяется переменной SKEL в /etc/default/useradd или, по умолчанию, etc/skel.

Если возможно, выполняется копирование ACL и расширенных атрибутов.

Изменение значений по умолчанию для создания новых пользователей

При вызове только с параметром -D, useradd отобразит текущие значения по умолчанию.

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

При вызове с -D плюс другие параметры, useradd обновит значения по умолчанию для указанных параметров. Допустимые варианты изменения по умолчанию:

-b, —base-dir BASE_DIR

Префикс пути к домашнему каталогу нового пользователя. Имя пользователя будет добавлено в конец BASE_DIR для формирования имени домашнего каталога нового пользователя, если опция -d не используется при создании новой учётной записи.

Этот параметр устанавливает переменную HOME в /etc/default/useradd.

-e, —expiredate EXPIRE_DATE

Дата, когда учётная запись пользователя заблокирована.

Эта опция устанавливает переменную EXPIRE в /etc/default/useradd.

-f, —inactive INACTIVE

Число дней, которые должны пройти после устаревания пароля, перед тем как учётная запись будет заблокирована.

Эта опция устанавливает НЕАКТИВНУЮ переменную в /etc/default/useradd.

-g, —gid ГРУППА

Имя или идентификатор группы для начальной группы нового пользователя (когда используется -N/—no-user-group или когда для переменной USERGROUPS_ENAB установлено значение no в /etc/login.defs). Указанная группа должна существовать, а числовой идентификатор группы должен иметь существующую запись.

Эта опция устанавливает переменную GROUP в /etc/default/useradd.

-s, —shell ОБОЛОЧКА

Имя командной оболочки пользователя.

Эта опция устанавливает переменную SHELL в /etc/default/useradd.

Файлы

/etc/passwd

содержит информацию о пользователях

/etc/shadow

содержит защищаемую информацию о пользователях

/etc/group

содержит информацию о группах

Читайте также:  Huawei matebook d16 linux kubuntu

/etc/gshadow

содержит защищаемую информацию о группах

/etc/default/useradd

значения по умолчанию для создаваемой учётной записи

/etc/skel/

каталог, содержащий файлы по умолчанию

/etc/subgid

Per user subordinate group IDs.

/etc/subuid

Per user subordinate user IDs.

/etc/login.defs

содержит конфигурацию подсистемы теневых паролей

Источник

Статья Как добавить или удалить обычного (не root) пользователя в Kali Linux

Стандартные пользователи и суперпользователи в Linux

Обычной практикой в большинстве дистрибутивах Linux является работа из-под обычного пользователя, который не имеет привилегий суперпользователя. Когда в этих привилегиях возникает необходимость, то, в зависимости от дистрибутива, используется команда sudoили вход под суперпользователем su –. В Kali Linux эта традиция нарушается, по умолчанию вся работа происходит под рутом. Этому есть объяснение — многие инструменты в дистрибутиве требуют прав рута, да и пользователями Kali Linux обычно являются не новички, и они понимают как безопасно работать и не разрушить систему.

Тем не менее, достаточно многих людей раздражает постоянная работа под суперпользователем. Эта инструкция расскажет, как добавить и как удалять пользователей (стандартных, которые не являются рутом) в Kali Linux. Кроме Kali Linux эта инструкция в полной мере применима к Debian и производным от Debian (Ubuntu, Linux Mint).

В первую очередь, это руководство покажет как:

  1. Добавить пользователя и все необходимые пользовательские директории (т. е. как избежать ошибки “Could not update .ICEauthority var/lib/gdm3/.ICEauthority” и вообще всех ошибок содержащих ICEauthority или проблемы с разрешениями).
  2. Добавить пользователя в группу sudo, чтобы позволять ему использовать команды рута. Вы также можете добавить пользователя в группу ‘lpadmin’, что позволит ему использовать принтеры Canon, HP и другие.
  3. Изменить шелл по умолчанию с chsh на bash. Или на любой шелл, например, Bourne Shell (sh), Bourne-Again Shell (bash), C Shell (csh) или Korn shell (ksh) и т.д..
  4. Войти под пользователем и показать, что не возникает никаких ошибок.
  5. Научиться использовать sudo, понимать группы и использовать их преимущества.
  6. Безопасно удалить пользователя.

Преимущества стандартного пользователя в Kali:

Войдя под обычным пользователем вы получаете несколько преимуществ в Kali

  1. Установка и запуск Google Chrome
  2. Установка и запуск менеджера пользователей и групп Gnome (установить gnome-system-tools)
  3. Использовать Kali в качестве главной операционной системы без постоянного беспокойства сломать её.

Ну а теперь давайте перейдём к самой инструкции.

Добавление пользователя Kali Linux:

  • Откройте терминал и напечатайте туда следующее для создания нового пользователя (замените mial на желаемое имя пользователя):

Источник

Adding a New Non-Root User in Kali Linux

Adding a New Non-Root User in Kali Linux

Kali Linux is a fantastic operating system for penetration testing and security evaluation. It comes with virtually all security tools built in, it’s lightweight by default, and it has a huge ecosystem that is constantly helping with the project.

For instructor-led Security training see our course schedule.

I created a new installation of Kali Linux recently. One of the first post-installation tasks I did was to create a new user for daily use. Sadly, Kali only creates a default root user during setup. Running as root all the time is a horrible security practice, so I recommend that you create a new user as soon as possible after installation.

To create a new user in Kali Linux, first pop open a Terminal window.

Then use the adduser command. In this example I’m creating a user named mikedan with a home directory of /mikedan so the command is adduser –home /mikedan mikedan.

Adduser prompts for the rest of the information, which is optional.

The user account is created. Now I test it by logging out from root and logging in as mikedan. To be sure I open a new Terminal window and type whoami.

Finished! The user account took only a few seconds to create and works as expected.

Mike Danseglio teaches IT Security Training, Windows, System Center and Windows Server 2012 classes at Interface Technical Training. His classes are available in Phoenix, AZ and online with RemoteLive™.

Источник

Users in kali linux

During the installation of amd64 and i386 images, it will prompt you for a standard user account to be created.

Any default operating system credentials used during Live Boot, or pre-created image (like Virtual Machines & ARM) will be:

Vagrant image (based on their policy):

  • Username: vagrant
  • Password: vagrant

Default Tool Credentials

Some tools shipped with Kali, will use their own default hardcoded credentials (others will generate a new password the first time its used). The following tools have the default values:

  • Username: beef
  • Password: beef
  • Configuration File: /etc/beef-xss/config.yaml
  • User: root
  • Password: (blank)
  • Setup Program: mysql_secure_installation
  • Username: admin
  • Password:
  • Setup Program: openvas-setup
  • Username: postgres
  • Password: postgres
  • Configuration File: /usr/share/metasploit-framework/config/database.yml
  • Username: empireadmin
  • Password: password123

For versions of Kali Linux older than 2020.1, here is our previous credential information and root policy information.

Updated on: 2021-Sep-27
Author: g0tmi1k

Источник

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

This guide will walk you through on how to add remove user (standard user or non-root user) in Kali Linux. I’ve tested this in Kali Linux, so any Debian or Debian derivative (such as Ubuntu) should just work.

This guide accomplishes:

The main reason I wanted to try this to demonstrate the followings:

  1. Add a user with all user directories already in place (thereby avoiding “Could not update .ICEauthority var/lib/gdm3/.ICEauthority” or any error containing .ICEauthority or permission in general.
  2. Add user to sudo group to allow him to use root commands. You can also add user to ‘lpadmin’ group to allow printing for Canon or HP and such. See Linux printing guide
  3. Change default shell from chsh to bash. Or any shell like Bourne Shell (sh), Bourne-Again Shell (bash), C Shell (csh) or Korn shell (ksh) etc.
  4. Login as that user and demonstrate there were no errors.
  5. Be able to use sudo and show groups affinity.
  6. Delete that user safely.
Читайте также:  3proxy windows server 2012

Benefits of Standard User in Kali:

Few benefits you have as non-root or standard user in Kali

  1. Install and run Google Chrome
  2. Install and run Gnome User and Groups manager (Install gnome-system-tools)
  3. Use Kali as Primary Operating System without worrying about breaking it all the time.

Now let’s move onto actual guide.

Add user in Kali Linux:

  • First of all let’s confirm which version of Linux and Kernel I’m running.In command prompt type in

    Now let’s add user. Open terminal and type following to create new user (replace user1 with your desired user name)

    (Note: -m means create home directory which is usually /home/username)

    Now set password for this user

    Enter desired password twice

    Add user to sudo group (to allow user to install software, allow printing, use privileged mode etc.)

    (Note: -a means append or add and –G mean to specified group/groups)

    Change default shell of previously created user to bash

    (Note: chsh mean change login shell, -s is the name of the specified shell you want for the user, in this case /bin/bash)

    Nice, all worked out as expected.
    Let’s logout and login back as our new Standard Non-root user (user1)

Check Also

Install, setup, configure and run OpenVAS on Kali Linux

Vulnerability scanning is a crucial phase of a penetration test and having an updated vulnerability …

How to install VirtualBox Guest Additions in Kali Linux (Kali Rolling / Kali Linux 2016.2 / Kali 2017)

Since Kali Linux 2016 came out (also known as Kali Rolling), it seems that Official …

51 comments

Thanks mate. Appreciate it.

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.

Thanks John. Appreciate it.

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

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

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

Hi Defalt,
No, sudo su — is never permanent .. If you want it to be permanent, you MUST login as ROOT user.
-BMO

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

Very insightful and informative….

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

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.

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

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.

When you say ‘username’, did you typed in the actual username ( i.e. bob, john) ?

Would you like will would help me find drivers WiFi builded in

plz help
How to remove my login detail from wtmp

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.

How to change the “root” name?

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

Thanks for the great post!

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

i shall now proceed to bookmark your page

Very Helpful. Thanks.

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

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

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 .

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

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?

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 …

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 …

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

Tnx for your reply.

I’ve made one with persistence.

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

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

[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.

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.

Источник

Читайте также:  Radeon graphic driver windows 10
Оцените статью