- Advanced Infrastructure Penetration Testing
- Chiheb Chebbi
- 220字
- 2021-06-24 19:12:59
Users and groups
The following subsection will cover the required Linux commands to manage user accounts and groups. To create a new user, use the useradd command; for example, useradd <user>.
Also, you are capable of adding more information about the new user, such as the related shell, the user directory, and expiration date:
useradd <user> -d </Directory>
useradd <user> -e <date>
useradd <user> -s <shell>
Every user must have a password, and in order to change the password, they need root access. To change a user password, use the passwd command, as follows:
passwd <user>
$ passwd
Changing password for user1
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
To remove a user, use the userdel command. For example, userdel -r <user>, where the -r option is added to delete the files of the selected user.
Using groups is a technique for managing Linux accounts. Organizing users into groups is a security measure, and an isolation approach. To list all the groups in a Linux system, show the group file in the /etc directory using the cat command.
As you can see from the screenshot, the group file contains all the groups in your Linux system. Just type cat /etc/group:

To create a new group, use the newgrp command newgrp <Group_Name>.
- 30天自制操作系統
- Google系統架構解密:構建安全可靠的系統
- Arch Linux Environment Setup How-to
- 玩到極致 iPhone 4S完全攻略
- Linux自動化運維:Shell與Ansible(微課版)
- 云原生落地:產品、架構與商業模式
- Django Project Blueprints
- Red Hat Enterprise Linux 6.4網絡操作系統詳解
- Linux基礎使用與案例
- 精解Windows 10
- Learning Continuous Integration with Jenkins(Second Edition)
- Linux從入門到精通(視頻教學版)
- Learning Joomla! 3 Extension Development(Third Edition)
- Windows Azure實戰
- Responsive Web Design by Example:Beginner's Guide(Second Edition)