What environment do I get with sudo?

I don't know about the defaults on Fedora, but on Debian sudo defaults to using the secure_path option with a default value of /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin.

This means the path is changed to that value every time you use sudo; but when you use sudo -i, the path is changed after that by the root user's RC files.


You can check this quite easy with things like

Compare the output from

sudo env 
env

And things like

sudo whoami 
whoami

That way you can try to find out what is missing in your setup.


The sudo -i command simulate initial login. On my Debian system, it also states that:

This means that login-specific resource files such as .profile or .login will be read by the shell. If a command is specified, it is passed to the shell for execution. Otherwise, an interactive shell is executed. sudo attempts to change to that user's home directory before running the shell. It also initializes the environment, leaving DISPLAY and TERM unchanged, setting HOME, MAIL, SHELL, USER, LOGNAME, and PATH, as well as the contents of /etc/environment on Linux and AIX systems. All other environment variables are removed.