Change personal account password If ordinary users want to change their personal account passwords, they only need to run the passwd command without any other commands:
Sample output: Changing password for nick (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully The system will prompt us to enter the current password first. If the password is correct, we will be asked to re-enter and confirm the new password. The next time you log in to the Linux system, you can use the new password. NOTE: When you enter your password, it will not be displayed on the screen. Change another user's password As a normal user, you can only change your own password. However, the root user and users with sudo privileges can change the passwords of other users. We need to log in as root user and type the following command to change the password for user nick: $ passwd nick Or use sudo command $ sudo passwd nick Output: You will be prompted to enter and confirm a new password Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Force the user to change password at next login By default, passwords are set to never expire. If you want to force the user to change their password at the next login, you need to use the passwd command with the --expireoption followed by the user's username, for example: $ sudo passwd --expire nick This will immediately expire the password for the user account. The next time the user tries to log in with their old password, a message will appear forcing them to change their password: $ ssh [email protected] Output: WARNING: Your password has expired. You must change your password now and login again! Changing password for nick. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Connection to 192.168.121.209 closed. After the user sets a new password, the connection is closed. You may also be interested in:
|
<<: express project file directory description and detailed function description
>>: mysql executes sql file and reports error Error: Unknown storage engine'InnoDB' solution
Installing Docker on CentOS requires the operatin...
Data cleaning (ETL) Before running the core busin...
pssh is an open source software implemented in Py...
1. MySQL gets the current date and time function ...
This article summarizes the notes for installing ...
Use the vscode editor to create a vue template, s...
Table of contents 1. Basic environment configurat...
Table of contents 1. Error phenomenon 2. Error An...
#include <asm/io.h> #define ioremap(cookie,...
Table of contents 1. Run workflow 2. Basic comman...
Table of contents Preface Single file components ...
The nginx configuration file is mainly divided in...
1. MYSQL installation directory Copy the code as ...
First: Installation of MySQL Download the MySQL s...
Table of contents 1- Error details 2-Single Solut...