sudo permissions without root access

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?

Answer

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.

Attribution
Source : Link , Question Author : ajon , Answer Author : faker

Leave a Comment