23Mar/102
How to be able to use your ssh agent forwarding after using sudo
Recently we have hit with a solution for an issue where we wanted our users to run certain secure commands as root, which included repository commits. This can easily happen to you if you use savon, for instance.
Because of the nature of savon, given that it understands not only about standard permissions and modes, but also of SELinux contexts, this tool can only be used properly as root, if you want to use all of its features.
The problem comes when you need non-root users, that work with certain files in a directory, to be able to commit these changes. You have to use sudo, which you surely already know. For increased security, standard distributions drop most environment variables when you run a command with sudo.