diskimage-builder/elements/rpm-distro/pre-install.d/00-fix-requiretty
Monty Taylor bec83686f4 Unset requiretty if it exists in sudoers
Fedora sets requiretty globally by default. This makes sense for
interactive machines with lots of password typing, but is pretty
attrocious for machines that might need users who remotely sudo to do
things. Just remove the setting.

Change-Id: Ic32bd92061a73f854683cc0d2d8919071dabe8cf
2014-11-28 11:35:00 -05:00

13 lines
420 B
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
# Fedora sets requiretty by default, which while great for machines that are
# going to see a lot of passwords sent over the wire because of interactive
# activity, that's not how we're using these. Remove the setting, and the
# comments about it
sed -i -e '/^Defaults\s*requiretty/d' -e '/Disable "ssh hostname/d' /etc/sudoers
sed -i -e '/You have to run/d' /etc/sudoers
visudo -c