[sudo-users] Pivot user for launching sqlplus
Todd C. Miller
Todd.Miller at sudo.ws
Tue Jun 25 14:05:53 MDT 2019
On Tue, 25 Jun 2019 16:57:28 -0300, Gabriel Menini wrote:
> OTOH, the alias I set in the /home/superora/.profile:
>
> alias sqlplus='/path/to/bin/sqlplus'
>
> is not being loaded as the enviroment variables did:
>From "Troubleshooting tips and FAQ for Sudo":
Q) When I run "sudo -i shell_alias" I get "command not found" even
though the alias is defined in my shell startup files.
A) Commands run via "sudo -i" are executed by the shell in
non-interactive mode. The bash shell will only parse aliases in
interactive mode unless the "expand_aliases" shell option is
set. If you add "shopt -s expand_aliases" to your .bash_profile
(or .profile if using that instead) the aliases should now be
available to "sudo -i".
More information about the sudo-users
mailing list