linux-- user password management, user switching

User Switching:

  • su Username: incomplete switching environment variable does not switch, or the original user information
  • su - Username: -l, complete switch, switch to the new user environment variables, and custom switching to a new user's home directory
  • su - username -c "command": using the specified user executes a command, finished retreat back to the original user

Password Tools:

  • passwd: change the user password
  • change: change the password policy (expiration time, etc.)
  • chpasswd: Quick, bulk change passwords

 

su - username -c "command": using the specified user executes a command, finished retreat back to the original user

 

passwd: change the user password

 Non-interactive Change Password: echo password | passwd --stdin user

chpasswd: Batch Change Password

chage: Modify User Password Policy

After a review of modifying the configuration file:

Guess you like

Origin www.cnblogs.com/franc/p/12503113.html