LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-22-2004, 11:42 AM   #1
salahuddin_66
Member
 
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283

Rep: Reputation: 30
halt or poweroff permission for users


how can i give

halt, poweroff and reboot permission to all user's

in slackware 9.1
 
Old 04-22-2004, 11:52 AM   #2
tmorton
Member
 
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198

Rep: Reputation: 31
Hi,

You can give halt and reboot SUID permissions with (as root):
Code:
chmod u+s /sbin/halt
chmod u+s /sbin/reboot
Then you can type /sbin/halt as any user

You can also use SUDO:
From http://www.userlocal.com/phorum/read...15442&t=15435:
Quote:
as root run visudo

this will open the /etc/sudoers file in the vi editor (Make sure you know how to use vi before opening that file

simply add the following line...

%users darkstar = /sbin/halt, /sbin/reboot
(replace "darkstar" with the hostname of your machine)

Now any user may issue sudo /sbin/halt to shut down the system
if you don't want to have to type a password each time then use this line

%users darkstar = NOPASSWD: /sbin/halt, /sbin/reboot

Now to me you seem like a lazy SOB so you probably don't want to type all that sudo stuff etc..

You can just create an alias for it ... simply add these to lines to your ~/.bash_profile (create this file if it doesn't exist)

alias halt='sudo /sbin/halt'
alias reboot='sudo /sbin/reboot'
HTH, Taj

Last edited by tmorton; 04-22-2004 at 11:54 AM.
 
Old 04-22-2004, 12:09 PM   #3
salahuddin_66
Member
 
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283

Original Poster
Rep: Reputation: 30
working..

thanx
 
Old 04-22-2004, 12:18 PM   #4
salahuddin_66
Member
 
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283

Original Poster
Rep: Reputation: 30
ooooooooooooooppppppppppppppppsssssssss

sorry

actually my shell was in su(root) so it works with halt and reboot

but as a user it wont if i edit this file with kwrite is there any problem
???
 
Old 04-22-2004, 12:29 PM   #5
tmorton
Member
 
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198

Rep: Reputation: 31
Hi,
Quote:
but as a user it wont if i edit this file with kwrite is there any problem
???
I think so. I tried to edit it in emacs, it didn't work. You've gotta use visudo...I guess. Donno why.
--Taj
 
Old 04-22-2004, 10:27 PM   #6
salahuddin_66
Member
 
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283

Original Poster
Rep: Reputation: 30
if i edit the file as root with kwrite is it will work
is it possible edit it with kwrite

???

but the problem in the file it says it will edit with vi

and i do not know vi

i must learn vi right..

what can i do...
 
Old 04-23-2004, 04:13 AM   #7
idris1388
Member
 
Registered: Mar 2004
Location: London, UK
Distribution: Slackware/Debian
Posts: 49

Rep: Reputation: 15
AAWR

You can edit the file with any editor. You will not damage the file.

If you don't like vi, you can try pico. Just type pico filename


Good luck
 
  


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
[help]: Poweroff & halt edison Linux - General 3 03-16-2005 09:40 AM
Halt, but no poweroff frzburn Slackware 4 02-19-2004 06:58 PM
poweroff will not halt system ceph Linux - General 1 11-06-2003 02:44 PM
SuSE 8.2 Will Not Poweroff, Shutdown, Reboot, Halt... whiskeypriest Linux - Newbie 4 09-18-2003 09:29 AM
halt/poweroff quirks saturn_vk Linux - Hardware 3 03-27-2003 02:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:11 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