LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-23-2004, 07:31 PM   #1
MikeFoo1
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1
Posts: 72

Rep: Reputation: 15
Shutdown ..?


I have a small question.If a regular user wants to shut the system down he/she will be able to do so.Now, to prevent this i could just edit /etc/shutdown.allow and add users who can actually be able to do such a thing(i have already done so).
The thing is, do i have to edit /etc/inittab as well?Do i just put :



Code:
 
# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -a
instead of :

Code:
 
# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t5 -r now
?
After i do this each time someone hits ctrl-alt-del the system will check if the user is allowed to halt the system, right ?
 
Old 04-23-2004, 08:29 PM   #2
Galileo430
LQ Newbie
 
Registered: Apr 2003
Distribution: Slackware 9.0
Posts: 9

Rep: Reputation: 0
That line always runs as root anyway. So it does not need a -a

Just
Code:
ca::ctrlaltdel:/sbin/shutdown -t5 -r now
will do just fine.
 
Old 04-23-2004, 08:51 PM   #3
MikeFoo1
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1
Posts: 72

Original Poster
Rep: Reputation: 15
Yes, i already have the -t5 -r now <- that reboots the system.I need shutdown.
Ok, how about this :

Quote:
shutdown can be called from init(8) when the magic keys
CTRL-ALT-DEL are pressed, by creating an appropriate entry
in /etc/inittab. This means that everyone who has physical
access to the console keyboard can shut the system down.
To prevent this, shutdown can check to see if an autho-
rized user is logged in on one of the virtual consoles. If
shutdown is called with the -a argument (add this to the
invocation of shutdown in /etc/inittab)
, it checks to see
if the file /etc/shutdown.allow is present. It then com-
pares the login names in that file with the list of people
that are logged in on a virtual console (from
/var/run/utmp). Only if one of those authorized users or
root is logged in, it will proceed. Otherwise it will
write the message
So, where do i add it then ?
 
Old 04-23-2004, 08:54 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
You've missed the point a little:
the line you currently have will let EVERYONE shut down the machine. Changing that line so that it has -a (as you're suggesting) would mean that only those people you specify in shutdown.allow (plus root) will be able to use CTRL-ALT-DELETE to shutdown.

i.e. if all you want to do is allow absolutely anyone to shut down then you've already achieved your goal. If however there are certain people you don't want to allow the shutdown rights, then you leave them out of shutdown.allow and add the -a option to the line that's there already.
 
Old 04-23-2004, 08:55 PM   #5
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
oh ps, you would just at the -a option to the line that already exists. the '-h now ' bits are necessary (just try running shutdown with no options).
 
Old 04-24-2004, 12:15 PM   #6
Galileo430
LQ Newbie
 
Registered: Apr 2003
Distribution: Slackware 9.0
Posts: 9

Rep: Reputation: 0
Ops.. My bad.. it should just be -h now not -r now..

The CTRL-ALT-DELETE catch runs as root, so there is no way to select who gets permission to do it via shutdown.allow. Since the user who calls that line is always root.
 
  


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
Please help on how to save services shutdown or shutdown from the terminal. wambuzz Linux - General 2 03-11-2005 08:38 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 07:21 PM
unable to 'shutdown' from x... need to shutdown using 'halt' guitarnix Linux - Newbie 5 11-24-2003 02:00 AM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 11:44 AM
shutdown hang during eth0 shutdown kurtisw Linux - Networking 5 10-30-2003 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:20 PM.

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