How to add and manage user accounts in CentOS 7?

In CentOS7, the following commands can be used to add and manage user accounts:

  1. You can add a user account using the following command.
sudo adduser username

This command will create a new user account and prompt you to set a password and other relevant information.

  1. You can modify user account information using the following commands:
sudo usermod -aG groupname username

This command adds the user to the specified user group.

  1. Remove user account: You can delete a user account using the following command:
sudo userdel -r username

This command will delete the user account along with its associated files and directories.

  1. Change User Password: The following command can be used to modify a user’s password.
sudo passwd username

This command will prompt you to enter and confirm a new password.

  1. Switch user account: You can use the following command to switch user accounts:
su username

This command will switch to the specified user account, requiring the user password for verification.

With these commands, you can easily add and manage user accounts to ensure the smooth running of system security and administration.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds