It seems when sudoing down that using sudo -u $user that the environment of root is still being used. How can I make sudo use the users environment? as a special note not all users that I will be using this on have login shells.
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
Try
|
|||
|
|
Alternatively you could use Here's part of the context in which I use
|
|||
|
|
# whoami => root # sudo -u user whoami => user– alex Nov 26 '10 at 6:54sudo -u useris analogous tosu userto switch the env in su you have to usesu - user– xenoterracide♦ Nov 26 '10 at 8:16-ualso ignores groups... I tried something from root (using sudo -u down) and it worked, apparently it didn't for the user... so I have to make sure I'm running commands in a way that would have all there limitations and environmental issues. – xenoterracide♦ Nov 26 '10 at 15:29