FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-10-2009, 10:09 AM
Jordi Moles Blanco
 
Default crontab command and permissions problem

Hi,

I'm having a problem trying to execute the "crontab" command from a perl
script. I'm writing to this list cause the same set up works in another
distro. Now i'm moving to Debian for convenience, but I'm having this
problem i can't fix.


The thing is... I'm using SNMP to automatize some processes on the
server, for example, to create a system user remotely. The script that
handles the creation of the user and so on is written in perl. The thing
is that, this way, i can create users, delete them and access absolutely
path in the server, cause... after all it is executed as root.


However, i'm facing only one problem with all the automated calls i've
had... i can't use "crontab". When i call this command from the SNMP
system, i get this:


"must be privileged to use -u"

the procedure is...

1. i create a cron file for a particular user in
/var/spool/cron/crontabs/username

2. i run "crontab -u username /var/spool/cron/crontabs/username"

I've tried to create the cron file, somewhere else, or to give it 777
permissions, but i always get the same error message.
I've even tried to log a "whoami" command before it executes "crontab",
and it says it's root, but then it says it is not allowed to execute the
command.


I've also tried to create the /etc/cron.allow file and many other things
i've found on several posts, but none has worked.


Could some tell me how to fix this or if there's another way to do same
thing?


Basically, i want to create a per-user crontab file. is there any other
way to do it a part from using "crontab" command?


Thanks.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-11-2009, 04:38 PM
Michael Iatrou
 
Default crontab command and permissions problem

When the date was Tuesday 10 February 2009, Jordi Moles Blanco wrote:

> I'm having a problem trying to execute the "crontab" command from a perl
> script.
>
> When i call this command from the SNMP system, i get this:
>
> "must be privileged to use -u"
>
> the procedure is...
>
> 1. i create a cron file for a particular user in
> /var/spool/cron/crontabs/username
> 2. i run "crontab -u username /var/spool/cron/crontabs/username"

You are not running the script as root. You may want to consider setuiding
your script (chmod +s) and install perl-suid.

--
Michael Iatrou (txnb)


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 09:36 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org