English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux passwd command

Linux Command大全

The Linux passwd command is used to change the user's password

Syntax

passwd [-k] [-l] [-u [-f]] [-d] [-S] [username]

Required Parameters:

  • -d Delete Password
  • -f Force User to Change Password on Next Login
  • -w Number of Days to Warn Before Password Expiry
  • -k Update Only Messages Sent After Expiry
  • -l Disable Account Use
  • -S Display Password Information
  • -u Enable the Disabled Accounts
  • -x Specify the Maximum Lifetime of the Password
  • -g Modify Group Password
  • Specify the Minimum Lifetime of the Password
  • -i How many days to disable the account after password expiry

Select Parameters:

  • --help Display Help Information
  • --version Display Version Information

Online Examples

Modify User Password

# passwd w3codebox  //Set w3Password for codebox user
Enter new UNIX password:  //Enter new UNIX password: No echo on input
Retype new UNIX password:  //Confirm Password
passwd: password updated successfully
# 

Display Account Password Information

# passwd -S w3codebox
w3codebox P 05/13/2010 0 99999 7 -1

Delete User Password

# passwd -d lx138 
passwd: password expiry information changed.

Linux Command大全