CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Sudo command not working !!!


New User

Dec 24, 2014, 12:15 AM

Post #1 of 2 (1186 views)
Sudo command not working !!! Can't Post


I am new to perl and have been trying a test script to perform a simple task by connecting to the root user and executing a command. I have not been very successful in this. Please assist. I have below: the sudoers file as well as my code piece. the test.log has no data in it.

# User alias specification User_Alias ROOT_ALLOW_SU=<myuser>
# Cmnd alias specification
# Defaults specification
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
ROOT_ALLOW_SU ALL = NOPASSWD: /usr/local/bin/suroot
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now

I run the following in perl and my file is not populated:

 system("sudo suroot -i /usr/bin/df -k > test.log");

Veteran / Moderator

Dec 24, 2014, 12:51 AM

Post #2 of 2 (1185 views)
Re: [Vishza] Sudo command not working !!! [In reply to] Can't Post

Is this really a Perl question? Hmm, not quite sure...

What happens when you run this command:

sudo suroot -i /usr/bin/df -k > test.log

from the shell prompt?


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives