LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-24-2005, 03:08 AM   #1
FarAway
LQ Newbie
 
Registered: Jul 2004
Posts: 18

Rep: Reputation: 0
How to shut down?


Hi all,

How can i shut down my Linux system by using command?

I've tried "shutdown now", but it dint work..

Anyone can tell me? Thank you....
 
Old 02-24-2005, 03:26 AM   #2
mjuhannus
Member
 
Registered: Sep 2004
Location: Finland
Distribution: Ubuntu 10.04, Debian 5, OpenSUSE 11.3
Posts: 60

Rep: Reputation: 15
As root run:
init 1
 
Old 02-24-2005, 05:00 AM   #3
FarAway
LQ Newbie
 
Registered: Jul 2004
Posts: 18

Original Poster
Rep: Reputation: 0
init 1 does not work....

bash: init: command not found

Anyone know why? Any other commands i can use?

Thanks...
 
Old 02-24-2005, 05:12 AM   #4
overlord73
Member
 
Registered: Apr 2004
Location: ..where no life dwells..
Posts: 541

Rep: Reputation: 30
init 1 is for single user mode. to halt system use
/sbin/init 0
or
/sbin/shutdown -h now
 
Old 02-24-2005, 10:13 AM   #5
FarAway
LQ Newbie
 
Registered: Jul 2004
Posts: 18

Original Poster
Rep: Reputation: 0
to run /sbin/init 0 or /sbin/shutdown -h now, i must be the root.
what command can i use if i wanna shut down as a user? is it permitted?
 
Old 02-24-2005, 12:25 PM   #6
nooch
LQ Newbie
 
Registered: Jan 2005
Posts: 10

Rep: Reputation: 0
Quote:
Originally posted by FarAway
to run /sbin/init 0 or /sbin/shutdown -h now, i must be the root.
what command can i use if i wanna shut down as a user? is it permitted?
you can't unless you are root. (unless a non-root user was given root permissions which is unlikely)
 
Old 02-25-2005, 02:45 AM   #7
overlord73
Member
 
Registered: Apr 2004
Location: ..where no life dwells..
Posts: 541

Rep: Reputation: 30
Quote:
Originally posted by FarAway
to run /sbin/init 0 or /sbin/shutdown -h now, i must be the root.
what command can i use if i wanna shut down as a user? is it permitted?
normally not by default, but you could solve it by using the command ´sudo´, this allows normal users to execute commands with root rights.

type (as root!) visudo and edit the file, e.g.:

[...]
Cmnd_Alias COMMAND1 = /sbin/shutdown
[...]
userX LOCAL=NOPASSWD: COMMAND1
[...]


now the user userX should be permitted to shutdown.
another solution could be:
-adding a new group (shutdown),
-modifying rights of /sbin/shutdown (chown root:shutdown /sbin/shutdown): chmod 4754 /sbin/shutdown
-setting setUID-Bit: chmod 4754 /sbin/shutdown
to allow ONLY users from shutdown group, otherwise EVERYONE could shutdown your box
 
Old 02-25-2005, 11:48 AM   #8
FarAway
LQ Newbie
 
Registered: Jul 2004
Posts: 18

Original Poster
Rep: Reputation: 0
ok....

Thanks a lot...
 
  


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
cannot shut down greenlinux Mandriva 6 06-17-2004 05:30 PM
shut down scialom Linux - Hardware 2 03-18-2004 09:14 AM
shut down won't shut system down taoweijia Linux - General 3 03-03-2004 07:05 PM
Can't shut down!! karleong Linux - Newbie 2 09-09-2003 08:51 PM
X won't shut down palooga Linux - Newbie 2 09-21-2002 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:52 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
Open Source Consulting | Domain Registration