DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 20th May 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default Why do we need password to shutdown the box ?

Code:
>uname -a
FreeBSD mybsd.zsoft.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:15:25 UTC 2012     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>cat /usr/local/etc/sudoers | grep NOPASSWD
%wheel ALL = NOPASSWD:/sbin/shutdown -p now,/sbin/shutdown -r now

>id
uid=1001(sw2wolf) gid=1001(sw2wolf) groups=1001(sw2wolf),0(wheel),5(operator),920(vboxusers)
However, I still need to input the root's password to shutdown the box when running `sudo /sbin/shutdown -p now` or `sudo /sbin/shutdown -r now` .
Reply With Quote
  #2   (View Single Post)  
Old 20th May 2012
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Code:
%wheel ALL = (root) NOPASSWD:/sbin/shutdown -p now,/sbin/shutdown -r now
Reply With Quote
  #3   (View Single Post)  
Old 22nd May 2012
sw2wolf sw2wolf is offline
λ programmer
 
Join Date: Mar 2012
Location: China
Posts: 89
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by graudeejs View Post
Code:
%wheel ALL = (root) NOPASSWD:/sbin/shutdown -p now,/sbin/shutdown -r now
thanks for your quick answer . It seems that there must be a SPACE after ":". So "NOPASSWD:/sbin/shutdown -p now" doensnot work but "NOPASSWD: /sbin/shutdown -p now" works !

Regards!
Reply With Quote
  #4   (View Single Post)  
Old 22nd May 2012
graudeejs's Avatar
graudeejs graudeejs is offline
Real Name: Aldis Berjoza
formerly killasmurf86
 
Join Date: Jul 2008
Location: Riga, Latvia
Posts: 588
Thanked 29 Times in 26 Posts
Default

Quote:
Originally Posted by sw2wolf View Post
thanks for your quick answer . It seems that there must be a SPACE after ":". So "NOPASSWD:/sbin/shutdown -p now" doensnot work but "NOPASSWD: /sbin/shutdown -p now" works !

Regards!
Right, I actually didn't notice, you don't have space... there (compared to my config)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
shutdown message derf FreeBSD General 5 14th December 2010 04:57 PM
openbsd shutdown phill OpenBSD General 3 27th October 2009 12:27 PM
shutdown message Mr-Biscuit FreeBSD General 1 16th November 2008 11:59 PM
enable shutdown/reboot xfce4 rex FreeBSD General 16 17th October 2008 02:19 PM
Shutdown problems radtek FreeBSD General 11 13th September 2008 12:42 AM


All times are GMT. The time now is 05:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick