Bugzilla – Bug 271
Sudoing to another account loses .profile settings
Last modified: 2007-12-01 19:39:41 MST
When using sudo to switch to another account (sudo account) it has been observed that some of the settings in the account's .profile are lost. If the account is accessed from root as su - account, this does not happen. Is there any reason/workaround for this?
Those setting are set by the target user's login shell. Since sudo runs commands, not a shell, there is no direct way for it to set them. In recent versions of sudo you can do things like: sudo -i -- -c "command args" which will run a login shell and pass it a command and args to run. I've been considering making "sudo -i command" behave in the same way but currently that will not do what you want.