Last active
April 18, 2016 17:31
-
-
Save dgoguerra/57a2ac65e82deed002e17a9665751403 to your computer and use it in GitHub Desktop.
Avoid 'sudo: sorry, you must have a tty to run sudo' error on Amazon Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SUDOERS_FILE=/etc/sudoers.d/999-vagrant-cloud-init-requiretty | |
echo 'Defaults:ec2-user !requiretty' > $SUDOERS_FILE | |
echo 'Defaults:root !requiretty' >> $SUDOERS_FILE | |
chmod 440 $SUDOERS_FILE | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment