You are not logged in.
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
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
"users" is the default group for any new user created. Hopefully you are already in it.
Offline
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
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
There's another recent thread on this here, with some additional information:
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
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