- 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>.
- Mobile-first Bootstrap
- Arch Linux Environment Setup How-to
- Linux性能優(yōu)化
- 深入Linux內(nèi)核架構(gòu)與底層原理(第2版)
- Windows Server 2019 Administration Fundamentals
- 網(wǎng)絡(luò)操作系統(tǒng)教程:Windows Server 2016管理與配置
- Android物聯(lián)網(wǎng)開發(fā)細(xì)致入門與最佳實(shí)踐
- Kali Linux 2018:Windows Penetration Testing
- Linux 從入門到項(xiàng)目實(shí)踐(超值版)
- 統(tǒng)信UOS應(yīng)用開發(fā)進(jìn)階教程
- Multi-Cloud for Architects
- Angular權(quán)威教程
- Implementing Domain-Specific Languages with Xtext and Xtend(Second Edition)
- 15分鐘!畫出我的漫畫角色:賣萌篇
- 深入理解Android:卷III