Technology Encyclopedia Home >How to create and manage user accounts on Arch Linux?

How to create and manage user accounts on Arch Linux?

Creating and managing user accounts on Arch Linux involves using the useradd, passwd, usermod, and userdel commands in the terminal.

To create a new user account, you can use the useradd command followed by the username you wish to create. For example, to create a user named "john", you would enter sudo useradd john. This command creates a new user with the default configuration.

To set or change a user's password, use the passwd command followed by the username. For instance, to set a password for "john", you would type sudo passwd john and follow the prompts to enter and confirm a new password.

To modify an existing user account, such as changing the user's home directory or adding them to a group, the usermod command is used. For example, to change "john's" home directory to "/home/john_new", you would enter sudo usermod -d /home/john_new john.

To delete a user account, use the userdel command. For example, to delete the "john" account, you would type sudo userdel john. If you also want to delete the user's home directory and mail spool, you can add the -r option: sudo userdel -r john.

For managing users in a more graphical interface or for managing large numbers of users, you might consider using a system management tool like Cockpit, which can be installed on Arch Linux and provides a web-based interface for managing various system tasks, including user accounts.

In a cloud environment, such as those offered by Tencent Cloud, user management can be handled through the cloud provider's identity and access management (IAM) services, which offer more advanced features for managing users, groups, roles, and permissions across cloud resources.