Added support for user change via sudo.