nerdexam
CompTIA

LX0-104 · Question #350

When logged in to a workstation which retrieves most of its user information from NIS, which command can be used to list ALL the users?

The correct answer is D. getent passwd. The getent passwd command is the standard way to retrieve user information from all configured name service sources, including NIS, as defined in /etc/nsswitch.conf.

Essential System Services

Question

When logged in to a workstation which retrieves most of its user information from NIS, which command can be used to list ALL the users?

Options

  • Acat /etc/passwd
  • Bshow users
  • Cypusers list
  • Dgetent passwd
  • Ecat /var/lib/nis/passwd

How the community answered

(26 responses)
  • C
    8% (2)
  • D
    88% (23)
  • E
    4% (1)

Why each option

The `getent passwd` command is the standard way to retrieve user information from all configured name service sources, including NIS, as defined in `/etc/nsswitch.conf`.

Acat /etc/passwd

The `cat /etc/passwd` command only displays users defined locally on the system, not those from NIS.

Bshow users

`show users` is not a standard Unix/Linux command for listing all users from NIS.

Cypusers list

`ypusers list` is not a standard NIS command; `ypcat passwd` would list the NIS password map but is less comprehensive than `getent`.

Dgetent passwdCorrect

The `getent` utility is designed to query databases configured in `/etc/nsswitch.conf`, which includes NIS if properly configured, allowing it to list users from both local and network sources.

Ecat /var/lib/nis/passwd

`cat /var/lib/nis/passwd` directly reads the NIS map file, which is not the standard or recommended way to query NIS for user information and may not be present or readable.

Concept tested: NIS user listing commands

Source: https://man7.org/linux/man-pages/man1/getent.1.html

Topics

#NIS#User management#getent command

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice