Change Unix "sudo" working directory? (Debian Unix)

Experts, I know when you use "sudo" it's binary and not of the regular sh variety in Unix...

But it always gets run from the directory that you execute it from as it's "working" directory.  Is there a way to force all "sudo" commands to use a different directory for this?

Case in point - I'm executing sudo commands from a website.  The "working directory" is wherever the sudo command is issued.  I'd like to redirect all of this to /root if this is at all possible.
LVL 5
usslindstromAsked:
Who is Participating?
 
Wasim Akram ShaikCommented:
no , it is not possible to change the working directory of sudo command..!!!
0
 
usslindstromAuthor Commented:
Understood.  Thanks for the info.
0
 
usslindstromAuthor Commented:
Er...  Sorry wdfdo1986 - accepted answer at the exact same time as your update, didn't see your post.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.