Bad user root in crontab


 
Thread Tools Search this Thread
Operating Systems Solaris Bad user root in crontab
# 8  
Old 05-03-2012
root.au - what is that crontab file for? More specifically -
when you do ANYTHING with crontabs you use the crontab -e command

So, following that concept as root you execute
Code:
crontab -e root.au

to create a crontab: root.au Did you use some other method to make that crontab?
Is there a root.au user in group sys? I think this is the cause of your problem, not the root account.
# 9  
Old 05-03-2012
1) The root Shell entry in /etc/passwd looks wrong to me. Is it really /user/bin/bash ?
When was the root Shell changed to bash ?
The root passwd entry has no UID and GID fields.
Anybody know what is going on here?
If you grep "root" /etc/passwd do you only find one line?

2) Please post the full directory listing because the timestamps, file permissions and file sizes could be important.
Code:
ls -la /var/spool/cron/crontabs

3) Please post:
Three most recent consecutive comand and error entries from the cron log complete with timestamps.
Can you match these to actual crontab lines?
I'm asking this because cron can also run "at" jobs and to determine whether cron is still running and to check where it is finding the failing jobs.
# 10  
Old 05-03-2012
hi, @jim mcnamara
there is a crontab file for root.au but its empty and
there is no group for root.au user sys.
Actually there is no cron job for root.au.
I connect to machine with root user. I create crontab with root user...
I mean, I did almost everything with root user.

---------- Post updated at 04:56 AM ---------- Previous update was at 04:27 AM ----------

hi @methyl,

I am really sorry. I typied accidently wrong. its /usr/bin/bash in passwd file.
1.Yes there is no UID or GID for root but it has group in /etc/group file.
(could that be reason for this error?)

And when I grep "root" /etc/passwd single line comes.

2.when I ls -la to crontab file the full line is

-rw---------- 1 root root 844 May 3 14:38 root

3.No... İn the log file errors are the same...

İt is

! bad user (root) thu may 3 14:50 2012
! bad user (root) thu may 3 14:51 2012
! bad user (root) thu may 3 14:52 2012 (this script must work every minute. Which gives error)


keep going like this...
# 11  
Old 05-03-2012
Please post the complete output from:
Code:
crontab -l root

And the complete output from:
Code:
ls -la /var/spool/cron/crontabs

Can you tell from the cron log whether cron is actually attempting to run any jobs or is this cron's normal one-minute polling interval failing.
Please post a few lines from the top of /etc/passwd so we can compare whether the root line is odd or start looking for some other authentication method.
Has anybody been editing the root line in /etc/passwd ?



Anybody viewing who has sunOS 5.10 Generic got a view on the root lines posted above from /etc/passwd and /etc/shadow ?
Is there a valid scenario whereby the UID and GID fields can be blank? Is it valid to have bash as the root Shell ?

Last edited by methyl; 05-03-2012 at 10:59 AM..
# 12  
Old 05-10-2012
Code:
crontab -l root

00 12  * * * /data/usr/shfolder/datapump.sh

Code:
ls -la /var/spool/cron/crontabs

-rw----------  1    root     sys       190   Apr 24 09:16  adm
-r-----------   1    root     root     450    apr   24   09:16   lp
-rw----------   1    root     root      844   May 3   16:45    root
-r------------   1    root     root       49    May 3    16:45    root.au
-rw----------  1     root     sys       308   Apr 24    09:16     sys

Code:
cat /etc/passwd

root:x:0:0:Super-User:/:/usr/bin/bash
bin:x:1:1::/:
sys:x:2:2::/:

Cron does not run any jobs, And yes... it gives bad user error every one-minute

---------- Post updated 05-10-12 at 04:52 AM ---------- Previous update was 05-09-12 at 11:37 PM ----------


Code:
Solved....

it's just because ,   hostname of machine....

all hostname's in /etc/hosts/ must be the same and correct...


Last edited by methyl; 05-10-2012 at 09:11 AM.. Reason: Please use code tags
# 13  
Old 05-10-2012
Quote:
Solved....

it's just because , hostname of machine....

all hostname's in /etc/hosts/ must be the same and correct...
Thank you for posting the solution. Can you be more specific about what was wrong with /etc/hosts , or was it a cron job which relied on /etc/hosts ? Not clear to me whether cron itself went faulty or whether one cron job went faulty.


Btw. Post #11 was quite misleading because of the three typing errors in the root line in /etc/passwd.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab error - bad hour

Hi All, While setting the crontab i am getting the below error, "/tmp/crontab.XXXXwKymEc" 156L, 15621C written crontab: installing new crontab "/tmp/crontab.XXXXwKymEc":74: bad hour Please help. Thanks (2 Replies)
Discussion started by: nag_sathi
2 Replies

2. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

3. Hardware

What are the possible action regarding having bad sector in my ext4 root partition?

Hi, I would like to ask about actions taken if any regarding having a few bad sector (67 bad sector according to DISK UTILITY) on my root ext partition except from buying a new HD and cloning it since my laptop is a 1 year old. Question: About clonzilla before this bad sector happens i used... (5 Replies)
Discussion started by: jao_madn
5 Replies

4. UNIX for Dummies Questions & Answers

Editing crontab of non-root user from file

Hi All, Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post) We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not... (6 Replies)
Discussion started by: nivedhitha
6 Replies

5. Solaris

"! bad user (root)" in cron log

I am getting the following error in the cron log: ! bad user (root) Wed Sep 22 14:30:00 2010 < root 8989 c Wed Sep 22 14:30:00 2010 rc=1 What does this mean? (5 Replies)
Discussion started by: jastanle84
5 Replies

6. UNIX for Dummies Questions & Answers

Cannot run crontab :1: bad minute error

Hi can any one help me out. while running crontab , m getting error bad minute time.. how to resolve this error. i created 1 txt file a.cron mirrordir -vm \home\t \homet1 & i saved it. then i created a crontab file ..with crontab -e & i added a line in it. * 1 * * * \root\a.cron & i save... (2 Replies)
Discussion started by: unxdost114
2 Replies

7. UNIX for Dummies Questions & Answers

If user has own crontab, results in accumulation of root CRON processes

Hello, I seem to be having a problem with accumulation of root CRON jobs occuring when I have a user's cron job(s) running. Here is an example of a user's crontab file: */1 * * * * echo "hello" > /dev/nullps aux|grep CRON root 14333 0.0 0.0 91236 2172 ? S ... (12 Replies)
Discussion started by: Narnie
12 Replies

8. AIX

Crontab cannot run by non-root user

Good morning everybody. I have just receiedv a complaint from our DBA saying that if he create a scripts to run some Oracle performance scripts using crontab and the scheduling part is ok but the job is failed when I checked on /var/adm/cron/log. I have tried his scripts using Oracle id directly... (4 Replies)
Discussion started by: kwliew999
4 Replies

9. UNIX for Advanced & Expert Users

crontab : bad minute error

when i say $crontab z it says ==> "z":6: bad minute "z":6: bad minute errors in crontab file, can't install. any clue why its happening? (1 Reply)
Discussion started by: crackthehit007
1 Replies

10. UNIX for Dummies Questions & Answers

Possible to give non root user sudo to "crontab -l"

Does anyone know if this is possible? I want to give some users access to root's crontab but only with a read privilege. Is this possible to do or can only root or people with full root sudo view root's cron? (4 Replies)
Discussion started by: LordJezoX
4 Replies
Login or Register to Ask a Question