nerdexam
LPI

010-160 · Question #81

What is true about the su command?

The correct answer is C. It runs a shell or command as another user. The su command allows a user to switch identity and run a shell or commands as another user, most commonly root.

Security and File Permissions

Question

What is true about the su command?

Options

  • AIt is the default shell of the root account.
  • BIt can only be used by the user root.
  • CIt runs a shell or command as another user.
  • DIt changes the name of the main administrator account.
  • EIt locks the root account in specific time frames.

How the community answered

(25 responses)
  • A
    4% (1)
  • C
    96% (24)

Why each option

The `su` command allows a user to switch identity and run a shell or commands as another user, most commonly root.

AIt is the default shell of the root account.

The default shell of the root account is defined in /etc/passwd (typically /bin/bash), not by the `su` command itself.

BIt can only be used by the user root.

Any user on the system can invoke `su` to switch to another user account, provided they supply the correct password for that target account.

CIt runs a shell or command as another user.Correct

The `su` (substitute user) command starts a new shell session or runs a single command under a different user account. By default, `su` without arguments switches to the root account, but any target user can be specified. It authenticates via the target user's password (except when root invokes it).

DIt changes the name of the main administrator account.

`su` does not rename or modify any account; account name changes require tools like `usermod`.

EIt locks the root account in specific time frames.

`su` has no functionality to lock accounts on a schedule; account locking is handled by tools like `usermod -L` or PAM configuration.

Concept tested: Purpose and behavior of the su command

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

Topics

#su command#user switching#privilege escalation#shell

Community Discussion

No community discussion yet for this question.

Full 010-160 Practice