- 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>.
- Designing Purpose:Built Drones for Ardupilot Pixhawk 2.1
- 每天5分鐘玩轉(zhuǎn)Kubernetes
- SharePoint 2013 應(yīng)用開發(fā)實(shí)戰(zhàn)
- 網(wǎng)絡(luò)操作系統(tǒng)管理與應(yīng)用(第三版)
- 云原生落地:產(chǎn)品、架構(gòu)與商業(yè)模式
- RHCSARHCE 紅帽Linux認(rèn)證學(xué)習(xí)指南(第7版)EX200 & EX300
- Python UNIX和Linux系統(tǒng)管理指南
- Red Hat Enterprise Linux 6.4網(wǎng)絡(luò)操作系統(tǒng)詳解
- CentOS 6 Linux Server Cookbook
- UI設(shè)計(jì)手繪表現(xiàn)從入門到精通
- 鴻蒙入門:HarmonyOS應(yīng)用開發(fā)
- Linux深度攻略
- Serverless Architectures with Kubernetes
- SAP后勤模塊實(shí)施攻略:SAP在生產(chǎn)、采購、銷售、物流中的應(yīng)用
- C#實(shí)用教程(第2版)