You are not logged in.

#1 2010-02-11 19:47:30

ebal
Member
From: Athens, Greece
Registered: 2009-05-26
Posts: 224
Website

crontab: Permission denied

I wanted to install a cron entry to rsync my home dir to my backup server.

[ebal@myarch ~]€ crontab -e
bash: /usr/bin/crontab: Permission denied

In the begging i thought that it was something i did.
So i re-installed dcron and tried again.
The same result.

I checked the perms:

[ebal@myarch ~]€ ls -l /usr/bin/crontab
-rwsr-x--- 1 root users 9948 Jan 19 05:20 /usr/bin/crontab

I synced my abs directory and looked on PKGBUILD

# by default, any member of group "users" can edit their own crontab
make PREFIX=/usr CRONTAB_GROUP=users CRONTABS=/var/spool/cron CRONSTAMPS=/var/spool/cronstamps || return 1

The obvious solution is to add my self to users group, but why this is a necessity?
Why by default all the users can not edit their crontab ?


https://balaskas.gr
Linux System Engineer - Registered Linux User #420129

Offline

#2 2010-02-11 19:56:37

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: crontab: Permission denied

What options are you mounting your file systems with? (Maybe show us your fstab)


Website - Blog - arch-home
Arch User since March 2005

Offline

#3 2010-02-11 20:01:04

ebal
Member
From: Athens, Greece
Registered: 2009-05-26
Posts: 224
Website

Re: crontab: Permission denied

If you can explain to me what is the connection between fstab & crontab (or even /etc/groups), i'll be glad to answer this.


https://balaskas.gr
Linux System Engineer - Registered Linux User #420129

Offline

#4 2010-02-11 20:02:14

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: crontab: Permission denied

"users" is the default group for any new user created. Hopefully you are already in it.

Offline

#5 2010-02-11 20:05:36

ebal
Member
From: Athens, Greece
Registered: 2009-05-26
Posts: 224
Website

Re: crontab: Permission denied

I dont think so,

[ebal@myarch ~]# useradd test
[ebal@myarch ~]# id test
uid=1004(test) gid=1004(test) ομάδες=1004(test)

And i've searched all the PKGBUILD files from core, i didnt find any other program that uses "users" group.


https://balaskas.gr
Linux System Engineer - Registered Linux User #420129

Offline

#6 2010-02-11 20:23:24

IR3uL
Member
From: Buenos Aires - Argentina
Registered: 2010-02-11
Posts: 6

Re: crontab: Permission denied

From the crontab manpage:

Only users who belong to the same group as the crontab binary will be able to install or edit crontabs.  However it'll be possible for  the superuser to install crontabs even for users who don't have the privileges to install them themselves.  (Even for users who don't have a login shell.). Only the superuser may use the -u or -c switches to specify a different user and/or crontab directory.

A posible solution is to set another group for the binary (eg: crontab) and only add the user allowed to run cron jobs to that group instead of users (users is more general). The drawback with this approach is updates might change ownership back to root:users.

Offline

#7 2010-02-11 20:50:52

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: crontab: Permission denied

There's another recent thread on this here, with some additional information:

http://bbs.archlinux.org/viewtopic.php?id=88116


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#8 2010-02-11 21:24:46

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: crontab: Permission denied

wikipedia wrote:

suid / nosuid
    Permit/Block the operation of suid, and sgid bits.

Just thought you might have that in your mount options


Website - Blog - arch-home
Arch User since March 2005

Offline

#9 2010-02-12 06:46:04

ebal
Member
From: Athens, Greece
Registered: 2009-05-26
Posts: 224
Website

Re: crontab: Permission denied

thanks everyone for their answers,
The Profjim's answer was what i was looking for


https://balaskas.gr
Linux System Engineer - Registered Linux User #420129

Offline

Board footer

Powered by FluxBB