Security

An administrator runs su - with no username. What is the result?

Show the answer

Correct answerA. After root's password is entered, a root login shell starts with root's environment in root's home directory

AWhy this is right: su - with no name targets root, asks for root's password and starts a login shell with root's environment.

BWhy not this: su asks for the target user's password; using one's own password is how sudo works.

CWhy not this: su prompts for root's password unless the caller is already root.

DWhy not this: Keeping the caller's environment and directory is plain su without the hyphen.

The hyphen makes su start a login shell for the target user, which defaults to root. That sets root's environment and home directory and requires root's password. Without the hyphen, much of the calling user's environment is kept.