Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-22-2004, 11:42 AM
|
#1
|
Member
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283
Rep:
|
halt or poweroff permission for users
how can i give
halt, poweroff and reboot permission to all user's
in slackware 9.1
|
|
|
04-22-2004, 11:52 AM
|
#2
|
Member
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198
Rep:
|
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.
|
|
|
04-22-2004, 12:09 PM
|
#3
|
Member
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283
Original Poster
Rep:
|
working..
thanx
|
|
|
04-22-2004, 12:18 PM
|
#4
|
Member
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283
Original Poster
Rep:
|
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
???
|
|
|
04-22-2004, 12:29 PM
|
#5
|
Member
Registered: Jan 2003
Location: In front of my computer in Oregon, USA
Distribution: Slackware
Posts: 198
Rep:
|
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
|
|
|
04-22-2004, 10:27 PM
|
#6
|
Member
Registered: Jan 2004
Location: Dhaka, Bangladesh
Distribution: Debian, Gentoo
Posts: 283
Original Poster
Rep:
|
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...
|
|
|
04-23-2004, 04:13 AM
|
#7
|
Member
Registered: Mar 2004
Location: London, UK
Distribution: Slackware/Debian
Posts: 49
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 08:04 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|