Red Hat Bugzilla – Bug 1478651
For sudo --login [command], .bash_profile is not read by shell
Last modified: 2017-08-05 12:18:23 EDT
Description of problem:
When "sudo --login" (without a command specified) is run, .bash_profile is read by the shell, in agreement with what the sudo man page states. However, when "sudo --login [command]" (with a command specified) is run, .bash_profile is not read by the shell, contrary to what the sudo man page states.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Run "sudo --login". A root login shell with '#' prompt is presented. Enter an alias for a command, such as "ll", and the command output is displayed. Exit the root shell.
2. Run "sudo --login ll", and a error message is displayed: "bash: ll: command not found" - the same error displayed when "sudo ll" is run.
When running "sudo --login ll", an error message results.
When running "sudo -i ll", the .bash_profile is read by the shell, and the command alias properly executes.
If this sudo behavior is considered to be correct, then the sudo man page needs to be clarified.