-2

I want to give certain users on my server access to run commands as apache, but I don't want to give them full root access.

Is there a way to allow a user to run a command similar to sudo -u apache ... while preventing them from having root permissions?

ajon
  • 309
  • 4
  • 11
  • Why the down vote? – ajon Apr 01 '14 at 21:17
  • I thought he just didn't want to give them full root access. If you really want to give them this power without `sudo` then, uh... Why?! – faker Apr 01 '14 at 21:28
  • 1
    @ajon - hover over the downvote arrow. This is very rudimentary sudo stuff, and the downvote is likely due to the fact that you show no research effort on an issue that would have been easily sorted out with a simple web search. – EEAA Apr 01 '14 at 21:45

1 Answers1

3

Yes, of course, this is exactly what sudo is for. e.g.:

ajon  ALL=(apache) /bin/ls

Allows the user ajon to run sudo -u apache /bin/ls.
See man sudoers.

faker
  • 17,326
  • 2
  • 60
  • 69