[TriLUG] Help with setuid C wrapper script

Kevin Hunter hunteke at earlham.edu
Wed Oct 13 09:08:16 EDT 2010


At 8:31am -0400 Wed, 13 Oct 2010, Ron Kelley wrote:
> Thanks for the syntax Jonathan. However, this is what happens when I
> try to do the command:
>
> [root at test-svr1 ~]# ssh rmaint at 1.2.3.4 "tail -100 /var/log/messages"
> tail: cannot open `/var/log/messages' for reading: Permission denied

/etc/sudoers is read by the sudo command.  Meaning that the user needs 
to use sudo.  Try:

$ ssh rmaint at 1.2.3.4 "sudo tail -100 /var/log/messages"

Note also that sudo requires the command to match /exactly/.  For 
instance if you had this in your sudoers file:

rmaint ALL=(root) NOPASSWD: /bin/ls /var/spool/cron/atjobs/

Then you would always need that trailing slash or will ask for a password:

$ sudo ls /var/spool/cron/atjobs
[sudo] password for rmaint:

Hope this helps,

Kevin



More information about the TriLUG mailing list