When sudo into another user, sudo will strip the environment for security reasons. When trying to do root actions that require ssh keys, all access has been lost.
For the root user, these can be kept without caveats because they have access to everything anyway :P So we add the following to /etc/sudoers using visudo (do not etc the /etc/sudoers file directly).