Change User Password in Linux

Source: Internet
Author: User

Environment

RedHat Linux 9 + VWWare 7.1.2 + Putty 0.62

Problem

Change User Password in Linux

Solution

Method 1

1. If you log on as a normal user, change your password and use the passwd command. You will be asked to enter your old password and then enter the new password twice.

[Www.bkjia.com @ localhost root] $ passwd
Changing password for user wgb.
Changing password for wgb
(Current) UNIX password:
New password:
Retype new password:
Passwd: all authentication tokens updated successfully.
[Www.bkjia.com @ localhost root] $

[Www.bkjia.com @ localhost root] $ passwd wgb
Passwd: Only root can specify a user name.

2. If you log on as a root user, use passwd root or passwd to change the root password. Enter the new password twice.

[Root @ localhost root] # passwd
Changing password for user root.
New password:
Bad password: it is too short
Retype new password:
Passwd: all authentication tokens updated successfully.
[Root @ localhost root] #

[Root @ localhost root] # passwd root
Changing password for user root.
New password:
Bad password: it is too short
Retype new password:
Passwd: all authentication tokens updated successfully.
[Root @ localhost root] #

Method 2
 
Log on as the root user, open the terminal, and execute echo "password you want to set" | passwd -- stdin User Name

[Root @ localhost root] # echo "wgb" | passwd -- stdin wgb
Changing password for user wgb.
Passwd: all authentication tokens updated successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.