search
HomeSystem TutorialLINUXIntroduction to Linux Basics View, Add, Modify, and Delete User Commands

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
What are the typical use cases for Linux versus Windows?What are the typical use cases for Linux versus Windows?May 03, 2025 am 12:01 AM

Linuxisidealforcustomization,development,andservermanagement,whileWindowsexcelsineaseofuse,softwarecompatibility,andgaming.Linuxoffershighconfigurabilityfordevelopersandserversetups,whereasWindowsprovidesauser-friendlyinterfaceandbroadsoftwaresupport

What are the differences in user account management between Linux and Windows?What are the differences in user account management between Linux and Windows?May 02, 2025 am 12:02 AM

The main difference between Linux and Windows in user account management is the permission model and management tools. Linux uses Unix-based permissions models and command-line tools (such as useradd, usermod, userdel), while Windows uses its own security model and graphical user interface (GUI) management tools.

How does the command line environment of Linux make it more/less secure than Windows?How does the command line environment of Linux make it more/less secure than Windows?May 01, 2025 am 12:03 AM

Linux'scommandlinecanbemoresecurethanWindowsifmanagedcorrectly,butrequiresmoreuserknowledge.1)Linux'sopen-sourcenatureallowsforquicksecurityupdates.2)Misconfigurationcanleadtovulnerabilities.Windows'commandlineismorecontrolledbutlesscustomizable,with

How to Make a USB Drive Mount Automatically in LinuxHow to Make a USB Drive Mount Automatically in LinuxApr 30, 2025 am 10:04 AM

This guide explains how to automatically mount a USB drive on boot in Linux, saving you time and effort. Step 1: Identify Your USB Drive Use the lsblk command to list all block devices. Your USB drive will likely be labeled /dev/sdb1, /dev/sdc1, etc

Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Best Cross-Platform Apps for Linux, Windows, and Mac in 2025Apr 30, 2025 am 09:57 AM

Cross-platform applications have revolutionized software development, enabling seamless functionality across operating systems like Linux, Windows, and macOS. This eliminates the need to switch apps based on your device, offering consistent experien

Best Linux Tools for AI and Machine Learning in 2025Best Linux Tools for AI and Machine Learning in 2025Apr 30, 2025 am 09:44 AM

Artificial Intelligence (AI) is rapidly transforming numerous sectors, from healthcare and finance to creative fields like art and music. Linux, with its open-source nature, adaptability, and performance capabilities, has emerged as a premier platfo

5 Best Lightweight Linux Distros Without a GUI5 Best Lightweight Linux Distros Without a GUIApr 30, 2025 am 09:38 AM

Looking for a fast, minimal, and efficient Linux distribution without a graphical user interface (GUI)? Lightweight, GUI-less Linux distros are perfect for older hardware or specialized tasks like servers and embedded systems. They consume fewer res

How to Install Wine 10.0 in RedHat DistributionsHow to Install Wine 10.0 in RedHat DistributionsApr 30, 2025 am 09:32 AM

Wine 10.0 stable version release: Running Windows applications on Linux to a higher level Wine, this open source and free application, allows Linux users to run Windows software and games on Unix/Linux operating systems, ushering in the release of the 10.0 stable version! This version has been provided with source code and binary package downloads, and supports various distributions such as Linux, Windows and Mac. This edition embodies a year of hard work and over 8,600 improvements, bringing many exciting improvements. Key highlights include: Enhanced support for Bluetooth devices. Improve support for HID input devices. Optimized performance of 32-bit and 64-bit applications.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function