Bug 228534 - sudo requires a tty even with NOPASSWD
sudo requires a tty even with NOPASSWD
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2007-02-13 12:19 EST by Karsten Hopp
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-15 09:05:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Karsten Hopp 2007-02-13 12:19:56 EST
Description of problem:
try the following:
- create a user 'build'
- give that user full sudo for yum without prompting for a password:
  echo "build ALL=(ALL) NOPASSWD: /usr/bin/yum" >> /etc/sudoers
(Don't do this at home, giving full yum sudo to any user is a bad idea)
- cat > /tmp/tst.sh << EOF
sudo -l
- chmod a+x /tmp/tst.sh
- su - build -c /tmp/tst.sh
sudo: sorry, you must have a tty to run sudo

this is wrong, sudo doesn't need a tty here as it doesn't need a password
Comment 1 Karsten Hopp 2007-02-15 09:05:40 EST
Ok, I've found out in the meantime that this was changed intentionally in FC-6.
Workaround is the following line in /etc/sudoers:

Defaults:build    !requiretty

Note You need to log in before you can comment on or make changes to this bug.