XK0-005 · Question #884
A systems administrator wants to execute /usr/local/bin/script.sh from the user1 account. Which of the following commands will accomplish this task?
The correct answer is B. su - user1 /usr/local/bin/script.sh. The su - user1 /usr/local/bin/script.sh command switches to the user1 account with a login shell (the -), and passes the script path so that it runs under user1’s identity. The other options either misuse the -c flag or invoke sudo incorrectly.
Question
A systems administrator wants to execute /usr/local/bin/script.sh from the user1 account. Which of the following commands will accomplish this task?
Options
- Asu -c user1 /usr/local/bin/script.sh
- Bsu - user1 /usr/local/bin/script.sh
- Dsudo -1 user1 /usr/local/bin/script.sh
How the community answered
(29 responses)- A10% (3)
- B72% (21)
- D17% (5)
Explanation
The su - user1 /usr/local/bin/script.sh command switches to the user1 account with a login shell (the -), and passes the script path so that it runs under user1’s identity. The other options either misuse the -c flag or invoke sudo incorrectly.
Topics
Community Discussion
No community discussion yet for this question.