LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Can't halt or reboot with user account!!!!!! (https://www.linuxquestions.org/questions/slackware-14/cant-halt-or-reboot-with-user-account-111398/)

TheShemeta 11-02-2003 04:23 AM

Can't halt or reboot with user account!!!!!!
 
Hi, guys

Sorry for bothering again, but do you know how can i halt or reboot my system with my user account. i can do that under root, but not with user. it's a lil not comfy.

Thanks a looot!

druuna 11-02-2003 05:25 AM

Most distro's have a gui to configure these things, don't know about Slackware.

You can also use the command line.

Create (check) a file in /etc called shutdown.allow, put the user in there.

Check man shutdown, the ACCESS CONTROL section.

TheShemeta 11-02-2003 06:29 AM

Hi,

thanks for the tipp, but i don't have this file. any other ideas?

MsMittens 11-02-2003 06:44 AM

Take a peak at the man shutdown page. I believe it gives information on how to setup a shutdown.allow page. You would need to create it in Slackware. :D

TheShemeta 11-02-2003 06:55 AM

well i checked the man shutdown & i saw that i miss

/etc/init.d/halt
/etc/init.d/reboot

what should i do next?

loonix 11-02-2003 07:10 AM

reboot or halt from unprivileged accounts
 
On my systems I prefer not to follow this method. I just use "su -c reboot" or "su -c halt"
This will ask for the root password and thats it.
No need to do any configuring. simple.

MsMittens 11-02-2003 07:11 AM

Keep in mind that the man pages are generic for the tool and assume that all *nixes are the same. They are not. For slackware, the halt/shutdown file is found in /etc/rc.d/rc.6.

Much 11-02-2003 08:27 AM

you just need the permission to run /sbin/shutdown and then set an alias to it.

you can do that with "chmod +s /sbin/shutdown" as root.
And then ad an alias to your ~/.bashrc : alias off=´/sbin/shutdown -h now´
;)

Astro 11-02-2003 11:07 AM

eeeh, i guess I'd consider that somewhat of a security risk having users able to reboot or halt the system. A friend of mine did it a lot as an annoyance to me when i did have it set. Angered me severly ;-P

TheShemeta 11-02-2003 11:26 AM

i am stuck! can someone explains it for a newbie? it's really frustrating!

Astro 11-02-2003 11:49 AM

In order to shutdown you can type this in a console...

su -c "shutdown -h now"

to reboot..

su -c "reboot"

In BOTH cases it will ask for the root password. This is your best and easiest bet for now.

zaphodiv 11-03-2003 06:28 AM

If you are physically at the machine another way is to configure it so that ctrl-alt-del halts the machine.

See this thread

DarknessX 11-03-2003 11:44 AM

Read the manpage of sudo. It's a secure way to allow users to shutdown/restart the computer -- no permisions to change.

man sudo

JGD 03-16-2004 07:28 AM

In slackware:
Using root, in Konqueror (file manager) on advanced permissions menu:
set uid for /sbin/shutdown
and add menu items:
for Halt - power down:
command: /sbin/shutdown -h now
for Reboot - power up:
command: /sbin/shutdown -r now

xgreen 03-16-2004 11:31 AM

you have to setuid /usr/sbin/halt
as root do:

chmod a+s /usr/sbin/halt
chmod a+s /usr/sbin/reboot

but make sure /usr/sbin path in your $PATH. if doesnt then create symlink from your path to /usr/bin.


All times are GMT -5. The time now is 09:45 PM.