LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-02-2004, 10:24 AM   #1
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Rep: Reputation: 15
shutdown/poweroff


The above commands can be invoked by only "root", but I want to make any user on system can execute the above commands,(the above command files has "rx" permissions to group as well as others also )
For regular user it is displaying message:

"shutdown: you must be root to do that!"

how can I do that????????
 
Old 09-02-2004, 10:34 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Try adding the users to the sudoers file: man sudo.
 
Old 09-02-2004, 01:34 PM   #3
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there..

unsafe tip chrism01 ..

Code:
man shutdown
will do the trick

you can create a file /etc/shutdown.allow with users that are allowed.

then you use shutdown -a

regards

slackie1000
 
Old 09-02-2004, 01:56 PM   #4
sirclif
Member
 
Registered: Sep 2004
Location: south texas
Distribution: fedora core 3,4; gentoo
Posts: 192

Rep: Reputation: 30
halt and reboot ask for su password, but can be executed as a user, halt is same as shutdown -h, and reboot is shutdown -r

>halt
password:
 
Old 09-02-2004, 03:22 PM   #5
Tamsco
Member
 
Registered: Jul 2004
Location: 1st Brillouin Zone
Distribution: Gentoo (not ricer Gentoo)
Posts: 165

Rep: Reputation: 30
but that involves every user having the root password, go with the sudo approach
 
Old 09-03-2004, 01:31 AM   #6
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Original Poster
Rep: Reputation: 15
Dear Friends !

By using "/etc/shutdown.allow" file even it was not allowing a regular user to shutdown the system

I invoked as following:

shutdown -a

file " /etc/shutdown.allow" contains a valid login name per each line
 
Old 09-03-2004, 03:04 AM   #7
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
Quote:
Originally posted by praveenv
Dear Friends !

By using "/etc/shutdown.allow" file even it was not allowing a regular user to shutdown the system

I invoked as following:

shutdown -a

file " /etc/shutdown.allow" contains a valid login name per each line
like i said before,

Code:
man shutdown
the best way is not invoking with "-a" option. you should add this parameter to your "shutdown script" at /etc/inittab.
it works for me:
/etc/shutdown.allow with some users
/etc/inittab => change shutdown parameter
user invokes "shutdown"

regards

slackie1000
 
Old 09-03-2004, 03:18 AM   #8
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Original Poster
Rep: Reputation: 15
Shutdown by any user

Ok I understood u....
but , I dont know how to set "-a" parameter in "/etc/inittab"

Kindly tell me this aslo
 
Old 09-03-2004, 05:01 AM   #9
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
hi there..

i am sorry. i read a bit fast the first post. my suggestion works fine for "ctrl-alt-del" combination. i wrote a script at home. i will check later and let you know if it is necessary.

if you want to setup the commands, like you wrote in your first post, i suggest a look here

there is everything that you need.
i suggest also read more the threads here before adding users in sudoers to shutdown without root password. it can be a serious security issue if you are running a server.

best regards

slackie1000
 
Old 09-03-2004, 08:07 AM   #10
praveenv
Member
 
Registered: Aug 2004
Location: India
Posts: 54

Original Poster
Rep: Reputation: 15
Shutdown

Thanku chrism01

Now it is possible through "sudo" command

ur idea at this time is very apreciatable

Thanku once again (Anyway do u know how to do same by using /etc/shutdown.allow)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
poweroff and shutdown with own user jaakkop Linux - General 6 12-29-2005 11:07 PM
SuSE 9.2 shutdown & poweroff Radarman SUSE / openSUSE 1 12-04-2004 02:38 AM
full shutdown, with poweroff scabies Linux - General 5 10-05-2004 10:38 AM
SuSE 8.2 Will Not Poweroff, Shutdown, Reboot, Halt... whiskeypriest Linux - Newbie 4 09-18-2003 10:29 AM
SuSE Linux 7 (2.2.16) does'nt poweroff during shutdown linbie Linux - General 2 04-09-2003 06:27 PM


All times are GMT -5. The time now is 06:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration