LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-04-2012, 06:12 AM   #1
pkraus109
LQ Newbie
 
Registered: Mar 2004
Posts: 23

Rep: Reputation: 16
sudo -u postgres


I have a virtual machine running ubuntu server (latest LTS forget the actual version number). I have setup sudo not to ask for a password but when I did that I could no longer do this ...

sudo -u postgres psql

I know get a password prompt and then this message after i enter my password ...

Sorry, user _____ is not allowed to execute '/usr/bin/psql' as postgres on teletraan1.pelsupply.com.

sudoers ...
root ALL=(ALL) ALL
%admin ALL=NOPASSWD: ALL

TIA!
 
Old 01-04-2012, 08:56 AM   #2
ochienged
Member
 
Registered: Oct 2007
Location: Plano, TX
Distribution: Fedora, CentOS, RHEL, Debian
Posts: 70

Rep: Reputation: 26
First you need to confirm that postgres is a member of the group admin. You can do that as below
Quote:
groups postgres | cut -d':' -f2
If so, then you seem to have a problem with the formatting of the sudo line for the group admins. The line that begins with '%admin'. It should appear as below
Quote:
%admin ALL=(ALL) NOPASSWD: ALL
If postgres is not a member of the group admin, you can add him as below
Quote:
usermod -G admin postgres

Last edited by ochienged; 01-04-2012 at 09:12 AM. Reason: Additional instructions
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The Ultimate Sudo FAQ — To Sudo Or Not To Sudo? LXer Syndicated Linux News 13 04-13-2013 01:36 AM
Can't use sudo, only account that's not root is not a sudo'ers [Ubuntu 9.10] randyriver10 Linux - Desktop 1 01-09-2010 07:56 PM
Problem with SUDO : sudo: pam_authenticate: Module is unknown cristoph_ Linux - Software 2 03-02-2009 07:12 PM
Changes in postgres without restarting postgres venki Linux - General 3 07-19-2007 01:06 AM
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration