Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm conservative about my sudoers policy. I'm trying to allow wheel users to run psql postgres postgres as the postgres user (because when ident that's the only way it works).

root ALL=(ALL) ALL
%wheel ALL=/usr/bin/psql

here's the error

 Sorry, user xenoterracide is not allowed to execute '/usr/bin/psql postgres postgres' as postgres on slave-vi.

The command I'm running is

sudo -u postgres psql postgres postgres 

The policy works for executing things as root, but I just need this specific command to run as postgres.

share|improve this question
up vote 0 down vote accepted
%wheel ALL = (postgres) /usr/bin/psql
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.