Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] vixie-cron: not allowed as user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Sat Jul 14, 2012 2:18 pm    Post subject: [solved] vixie-cron: not allowed as user Reply with quote

I had a problem accessing crontab as normal user. I could access it as root: 'crontab -u elmarotter -e', but not as normal user. I'm using vixie-cron. I did solve the problem, but I would like to know it is wright what I did.

Config:
Code:

elmarotter@masterserver ~ $ cat /etc/cron.deny
# $Id: vixie-cron-4.1-cron.deny,v 1.1 2005/03/04 23:59:48 ciaranm Exp $
# If for any reason you have users in the 'cron' group who should not
# be allowed to run crontab, add them to this file (one username per
# line)
all

elmarotter@masterserver ~ $ cat /etc/cron.allow
elmarotter
mailman

elmarotter@masterserver ~ $ ls -la /var/spool/cron/
totaal 16
drwxr-x--- 4  755 cron 4096 12 jul 20:12 .
drwxr-xr-x 9 root root 4096  2 jun 13:34 ..
drwx-wx--T 2  755 cron 4096 14 jul 15:57 crontabs
-rw-r--r-- 1  755 root    0 12 jul 20:12 .keep_sys-process_cronbase-0
drwxr-x--- 2  755 root 4096 14 jul 16:00 lastrun


Reemering 'cronbase' did not resolve the problem.

Code:

masterserver crontabs # ls -la
totaal 24
drwx-wx--T 2 root cron 4096 14 jul 15:57 .
drwxr-xr-x 4 root cron 4096 12 jul 20:12 ..
-rw------- 1 root cron  665  6 jun  2011 amavis
-rw------- 1 root cron  278 14 jul 13:20 elmarotter
-rw-r--r-- 1 root cron    0  8 jun 23:14 .keep_sys-process_vixie-cron-0
-rw------- 1 root cron 1597 14 jul 15:57 mailman
-rw------- 1 root cron 1876 14 jul 13:26 root


I changed permissies to 'g+rx'. Now I can access crontab again.
Code:

masterserver crontabs # ls -la
totaal 24
drwx-wx--T 2 root cron 4096 14 jul 15:57 .
drwxr-xr-x 4 root cron 4096 12 jul 20:12 ..
-rw-r-x--- 1 root cron  665  6 jun  2011 amavis
-rw-r-x--- 1 root cron  278 14 jul 13:20 elmarotter
-rw-r--r-- 1 root cron    0  8 jun 23:14 .keep_sys-process_vixie-cron-0
-rw-r-x--- 1 root cron 1597 14 jul 15:57 mailman
-rw------- 1 root cron 1876 14 jul 13:26 root


Last edited by elmar283 on Fri Aug 10, 2012 10:11 pm; edited 2 times in total
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Sat Jul 14, 2012 2:36 pm    Post subject: Reply with quote

There still seems to be a problem:
Code:
crontab: installing new crontab
crontab: error renaming crontabs/tmp.XXXXo74fp4 to crontabs/elmarotter
rename: Bewerking niet toegestaan
crontab: edits left in /tmp/crontab.XXXXm1T7qY
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1937
Location: Zurich, Switzerland

PostPosted: Sat Jul 14, 2012 2:45 pm    Post subject: Reply with quote

revert all changes, and add the user to group cron. then logout and login again.


V.
_________________
read the portage output!
If my answer is too short, just ask for an explanation.
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Sat Jul 14, 2012 2:57 pm    Post subject: Reply with quote

User elmarotter is in the cron group:
Code:

elmarotter@masterserver /var/spool/cron $ groups elmarotter
wheel audio cdrom video users cron apache wireshark elmarotter


I did revert everything en re-emerged cronbase, with the result that I cannot do 'crontab -e' as a user.

Any sugestions?
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1937
Location: Zurich, Switzerland

PostPosted: Sun Jul 15, 2012 11:01 am    Post subject: Reply with quote

could ou post the permissions of /var/spool/cron/crontabs (e.g ls -lad /var/spool/cron/crontabs)

V.
_________________
read the portage output!
If my answer is too short, just ask for an explanation.
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Sun Jul 15, 2012 11:27 am    Post subject: Reply with quote

Here it is:
Code:

elmarotter@masterserver ~ $ ls -lad /var/spool/cron/crontabs
drwx-wx--T 2 root cron 4096 14 jul 16:36 /var/spool/cron/crontabs
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Fri Aug 10, 2012 7:32 pm    Post subject: Reply with quote

I still don't know why I can't access the crontab for regular users. Is there anyone who knows how to fix this?
Could it have something to do with having hardned sources?
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4063
Location: Saint Amant, Acadiana

PostPosted: Fri Aug 10, 2012 7:36 pm    Post subject: Reply with quote

Looking at /etc/group it seems there is also crontab group.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Fri Aug 10, 2012 8:29 pm    Post subject: Reply with quote

user elmarotter is now member of crontab group. I logged out and in again. Still no luck:
Code:


elmarotter@masterserver ~ $ groups
wheel cron audio cdrom video apache users crontab wireshark elmarotter
elmarotter@masterserver ~ $ crontab -e
crontabs/elmarotter: Toegang geweigerd
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4063
Location: Saint Amant, Acadiana

PostPosted: Fri Aug 10, 2012 8:43 pm    Post subject: Reply with quote

I just checked in two of my boxes the owner of parent directory is root:crontab, my user's crontab belongs to <user>:crontab. I'd try and change it, I see in your box it is root:cron.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Fri Aug 10, 2012 8:52 pm    Post subject: Reply with quote

Thanks that did the trick. Just to be sure: this is what you meant?:
Code:


elmarotter@masterserver /var/spool/cron $ sudo ls -la crontabs/
totaal 24
drwx-wx--T 2 root       cron    4096 10 aug 22:47 .
drwxr-x--- 4 root       cron    4096 14 jul 16:50 ..
-rw------- 1 amavis     cron     665  6 jun  2011 amavis
-rw------- 1 elmarotter crontab  278 10 aug 22:47 elmarotter
-rw-r--r-- 1 root       cron       0  8 jun 23:14 .keep_sys-process_vixie-cron-0
-rw------- 1 mailman    cron    1597 14 jul 15:57 mailman
-rw------- 1 root       cron    1876 14 jul 13:26 root
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4063
Location: Saint Amant, Acadiana

PostPosted: Fri Aug 10, 2012 9:03 pm    Post subject: Reply with quote

If it worked, great. The parent directory ownership is still different.

drwx-wx--T 2 root crontab 54 May 22 08:15 .
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Fri Aug 10, 2012 9:42 pm    Post subject: Reply with quote

Like this?:
Code:

elmarotter@masterserver /var/spool/cron $ sudo ls -la crontabs/
totaal 24
drwx-wx--T 2 root       crontab 4096 10 aug 22:50 .
drwxr-x--- 4 root       crontab 4096 14 jul 16:50 ..
-rw------- 1 amavis     crontab  665  6 jun  2011 amavis
-rw------- 1 elmarotter crontab  277 10 aug 22:50 elmarotter
-rw-r--r-- 1 root       crontab    0  8 jun 23:14 .keep_sys-process_vixie-cron-0
-rw------- 1 mailman    crontab 1597 14 jul 15:57 mailman
-rw------- 1 root       crontab 1877 10 aug 22:50 root
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4063
Location: Saint Amant, Acadiana

PostPosted: Fri Aug 10, 2012 10:06 pm    Post subject: Reply with quote

Like this
Code:
ls -la /var/spool/cron/crontabs/
total 4
drwx-wx--T 2 root crontab  54 May 22 08:15 .
drwxr-x--- 4 root cron     70 Feb 22 18:59 ..
-rw-r--r-- 1 root root      0 Feb 22 20:09 .keep_sys-process_vixie-cron-0
-rw------- 1 saul crontab 287 May 22 08:15 saul

_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
elmar283
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2004
Posts: 142
Location: Netherlands

PostPosted: Fri Aug 10, 2012 10:10 pm    Post subject: Reply with quote

Then this should be it:
Code:


elmarotter@masterserver /home/ftp/elmarotter $ sudo ls -la /var/spool/cron/crontabs/
totaal 24
drwx-wx--T 2 root       crontab 4096 10 aug 22:50 .
drwxr-x--- 4 root       cron    4096 14 jul 16:50 ..
-rw------- 1 amavis     crontab  665  6 jun  2011 amavis
-rw------- 1 elmarotter crontab  277 10 aug 22:50 elmarotter
-rw-r--r-- 1 root       root       0  8 jun 23:14 .keep_sys-process_vixie-cron-0
-rw------- 1 mailman    crontab 1597 14 jul 15:57 mailman
-rw------- 1 root       crontab 1877 10 aug 22:50 root
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4063
Location: Saint Amant, Acadiana

PostPosted: Fri Aug 10, 2012 10:25 pm    Post subject: Reply with quote

Yep, glad you got it sorted. :)
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum