Vishza has asked for the wisdom of the Perl Monks concerning the following question:
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>I run the following in perl and my file is not populated: system('sudo suroot -i /usr/bin/df -k > test.log');
# 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
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sudo not working
by ww (Archbishop) on Dec 24, 2014 at 15:22 UTC | |
by Vishza (Initiate) on Jan 06, 2015 at 21:33 UTC | |
|
Re: sudo not working
by Anonymous Monk on Dec 24, 2014 at 13:55 UTC |