XK0-005 · Question #1583
XK0-005 Question #1583: Real Exam Question with Answer & Explanation
The correct answer is A: su - Joe. The su command is used to switch to another user account on Linux systems. The - option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of t
Question
Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the ls command. The output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files?
Options
- Asu - Joe
- Bsudo Joe
- Cvisudo Joe
- Dpkexec Joe
Explanation
The su command is used to switch to another user account on Linux systems. The - option makes the shell a login shell, which means that it will read the profile and environment variables of the target user. Without this option, the shell will retain the environment variables of the original user. This can cause confusion when issuing commands that depend on these variables, such as ls, which uses the $HOME variable to determine the home directory. Therefore, Ann should have issued su - Joe to list Joe's files instead of her own.
Topics
Community Discussion
No community discussion yet for this question.