Why do I get an "Unable to open file ego.conf" error when I try to use "sudo egosh ego start" to start the cluster?

This is because the operating system resets the environment so that it only contains the LOGNAME, SHELL, USER, USERNAME, and SUDO_ variables by default. As a result, EGO_CONFDIR is not set in the sudo environment.Add the following line to the top of the /etc/sudoers file to preserve all the user environment variables when using "sudo":

Defaults !env_reset