Home >System Tutorial >LINUX >Introduction to Linux Basics View, Add, Modify, and Delete User Commands

Introduction to Linux Basics View, Add, Modify, and Delete User Commands

WBOY
WBOYOriginal
2024-06-22 15:37:26468browse

Linux 基础之查看、添加、修改、删除用户命令介绍

1./etc/passwd file to view user information

Match the user login name with the corresponding UID value, which contains some user information:

Linux基础之查看、添加、修改、删除用户命令介绍Linux基础之查看、添加、修改、删除用户命令介绍

Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands. Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands

Use commas as delimiters to divide into 7 columns, which are:

We can directly change this file to add, delete, and modify accounts, but it is highly not recommended. This is very dangerous. If it is damaged, it will make it difficult for users to log in.

2.useradd add account

Commonly used methods:

删除用户组的linux命令_linux 删除用户_删除用户Linux

Code language: javascript

Copy

useradd username -m -s /bin/bash -d /home/username -g groupname

Parameter description:

删除用户Linux_删除用户组的linux命令_linux 删除用户

3.usermod change account

It is worth noting that usermod-p is used to change passwords, so be careful. The connection next to usermod-p is not plain text linux delete user, but ciphertext linux delete user, for example: usermod-p123user1, You thought you were changing user1's password to 123, but when you log in and enter 123, you will unfortunately find that you cannot log in.

4. Special tools passwd and chpasswd to change passwords

Passwdroot#Change root password

Linux基础之查看、添加、修改、删除用户命令介绍Linux基础之查看、添加、修改、删除用户命令介绍

Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands.Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands

passwd-euser1# Force the user to change their password when they logged in last time.

Note: Ordinary users can only change their own passwords, and only root users have the permission to change other passwords.

删除用户Linux_linux 删除用户_删除用户组的linux命令

chpasswd is used to change user passwords in Linux kernel in large quantities. It can manually read usernames and passwords through standard input

chpasswd

Linux基础之查看、添加、修改、删除用户命令介绍Linux基础之查看、添加、修改、删除用户命令介绍

Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands. Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands

The above are the basic operations of adding, modifying, and deleting users. Due to space limitations, this article does not discuss the common operations of the Linux virtual host in the Linux group, which will be listed later.

The above is the detailed content of Introduction to Linux Basics View, Add, Modify, and Delete User Commands. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn