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.
Question
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)- A4% (1)
- C96% (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.
The default shell of the root account is defined in /etc/passwd (typically /bin/bash), not by the `su` command itself.
Any user on the system can invoke `su` to switch to another user account, provided they supply the correct password for that target account.
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).
`su` does not rename or modify any account; account name changes require tools like `usermod`.
`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
Community Discussion
No community discussion yet for this question.