I am trying to configure a web server to be able to call certain commands as an elevated permissions user. The problem I am running into is i need to ssh to another server and run a command on that machine all as the elevated user. I only want certain commands to be able to be processed but the user needs to be able to specify part of the command, say a cat <file> | grep <wildcards>. I want to do this but every way I have been able to think of, only opens a possible security hole.
What are some of your suggestions?