To add an existing user to an existing group on a local Linux system, which file should be edited?

Prepare for the CompTIA Server+ Exam. Use flashcards and multiple choice questions to test your knowledge of server installation, configuration, and management. Ace your exam with comprehensive study guides and detailed explanations!

To add an existing user to an existing group on a local Linux system, the appropriate file to edit is the /etc/group file. This file contains information about all the groups on the system and their associated members. Each line in this file represents a group and consists of several fields: the group name, the group password (if applicable), the group ID (GID), and a comma-separated list of usernames that are members of the group.

When you want to add a user to a group, you can edit this file directly, appending the username of the user to the list of group members for the specified group. However, it's common practice to use command-line tools like usermod or gpasswd for this operation, as these tools will handle the file editing and validation processes automatically, reducing the risk of errors.

The other files mentioned have different purposes. The /etc/passwd file holds user account information, including usernames and user IDs, but does not manage group membership. The /etc/hosts file is used for hostname resolution, mapping hostnames to IP addresses. Finally, the /etc/group_membership file is not a standard file in Linux systems and is not used for managing group memberships. Therefore, the /

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy