March 18th, 2013, 12:26 AM
-
SUDO problem
Hi, I am using python version 2.7.3 on UBUNTU. I am using 'sudo' to run a bash command in login page. It is giving me error 'sudo unable to resolv host 'hostname'.
In the command line, when I use the command 'sudo hostname', it is giving me the error as well as the output. Can any one help... please?? This is my sudoers file. Please suggest me the changes in sudoers file if any:
Code:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
#Defaults env_reset
#Defaults requiretty
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
tester ALL=(ALL) NOPASSWD: ALL
www-data ALL=(ALL) NOPASSWD: ALL
# Allow members of group sudo to execute any command
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
www-data ALL=NOPASSWD: ALL
March 18th, 2013, 09:12 PM
-
Your syntax is wrong for www-data, look at some of the other users
======
Doug G
======
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton
March 19th, 2013, 11:26 AM
-
Just another question? Why are you trying to give your www-data user permissions to run sudo on any command with NO password. That's a HUGE security hole. At the most, you should only allow it to run a specific command.
Comments on this post
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
March 27th, 2013, 06:05 AM
-
As per the error info "sudo unable to resolv host 'hostname" the issue may be in host file
Go to System -> Administration -> Network -> Hosts
Check the entry for 127.0.1.1 and see if it matches the hostname. Also paste the following output
cat /etc/hosts