Quote:
You can set the suid bit using the chmod command. Code:
# chmod 4666 /sbin/shutdown |
Hmm something's bizarre... I did chmod 555 to shutdown so now I can shutdown without being root
but the cron job still doesn't load. This time I decided to use KCron to schedule my job. Here's my output for crontab -l: # DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/kde-vicente/kcronCPW9Ja.tmp installed on Fri Oct 29 15:32:53 2004) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) # apagación 0,15,30,45 0,1,2,3 * * 1,2,3,4,5 shutdown -h now # apagación weekend 30 1,2,3,4,5 * * 6,7 shutdown -h now # This file was written by KCron. Copyright (c) 1999, Gary Meyer # Although KCron supports most crontab formats, use care when editing. # Note: Lines beginning with "#\" indicates a disabled task. It's 1:34am on Saturday and the scheduled 1:30 shutdown still hasn't come. |
Dude can you make set the uid bit on shutdown
assuming you have the binary shutdown at /sbin/shutdown Code:
now become root and Only one issue here is any user on the machine can shut it down. Nitin :) |
Have you tried this:
Edit as root: /etc/crontab 0 1 * * * root /sbin/shutdown -h now This will execute the command as root (assuming cron is working correctly) w/out sudo. --- If you were want to use SUDO you have to edit the sudoers file and add a NOPASSWD:shutdown to that user to allow it to shutdown without a password. example susoers file: User_Alias SHUTDWN = user Cmnd_Alias SHUTDOWN = /sbin/shutdown SHUTDWN = ALL=NOPASSWD:SHUTDOWN Then you could use crontab as user with SUDO to shutdown the machine w/out a password. Hopfully this helps in some way. |
Thanks guys, it works now. The main problem was with the permissions to run shutdown and putting that command's path in.
:) |
All times are GMT -5. The time now is 04:52 AM. |