Security

An administrator runs su root and finds the working directory is still their own home directory and PATH lacks /usr/sbin. Which command BEST gives a root shell with root's own environment, home directory and PATH?

Show the answer

Correct answerA. su - root

su - starts a login shell, so root's profile, home directory and PATH are used. su -m and sudo -E deliberately preserve the calling user's environment, which is the opposite of what is needed. newgrp only changes the group.