Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pick up users .profile when running commands via sudo

Status
Not open for further replies.

pbut81

Technical User
Jul 2, 2007
1
DE
When you run a command as a specified user via sudo by using the '-u' flag the environment of that user is not picked up by sudo. Does anyone know of anyway this can be changed within sudo or otherwise?
 
sudo -H -u <username> command

should work

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top