LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-07-2013, 07:31 PM   #1
sniper8752
Member
 
Registered: Oct 2012
Posts: 339

Rep: Reputation: Disabled
shuting down at terminal login prompt


how do I shutdown my linux machine at terminal login prompt?
 
Old 02-07-2013, 07:35 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
As root
Code:
# shutdown + power off
shutdown -h now

# reboot
shutdown -r now
These are for clean controlled shutdowns. Some systems may use 'halt' and 'reboot', but these may or may not do a clean controlled shutdown. You should check if you intend to use them.
 
Old 02-07-2013, 07:38 PM   #3
sniper8752
Member
 
Registered: Oct 2012
Posts: 339

Original Poster
Rep: Reputation: Disabled
am i just entering these for the login name, then nothing for the password?
 
Old 02-07-2013, 07:39 PM   #4
ted_chou12
Member
 
Registered: Aug 2010
Location: Zhongli, Taoyuan
Distribution: slackware, windows, debian (armv4l GNU/Linux)
Posts: 421
Blog Entries: 28

Rep: Reputation: 2
No you do need to login before you enter shutdown.
http://linux.die.net/man/8/shutdown gives you a complete idea, such as:
Code:
shutdown -h +10
Shutdown in ten minutes.
 
Old 02-07-2013, 09:37 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,822

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
you ALSO need to be root to use those two commands

a normal user should not be allowed run them in the terminal
 
Old 02-07-2013, 10:03 PM   #6
sniper8752
Member
 
Registered: Oct 2012
Posts: 339

Original Poster
Rep: Reputation: Disabled
i am still confused. when it asks for my login, what do i put for that?
 
Old 02-07-2013, 10:09 PM   #7
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Your question is being misunderstood.

You can't shutdown the computer when you are not logged in, simple as that. Linux is a multi-user system. If you are not logged in, other users might be. So a user not logged in has no access to the system to prevent that you do things you are not authorized to, like shutting down.

jlinkels
 
Old 02-07-2013, 10:48 PM   #8
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by sniper8752 View Post
how do I shutdown my linux machine at terminal login prompt?
As previously mentioned, you must be logged in use the shutdown command.

Then of course, there's the power button. If the machine is ACPI enabled (all modern systems are), simply press the power button. ACPI will then send the proper signals to the kernel to perform an orderly shutdown.

Note though, if you hold down the power button for too long (about 5 secs on my machine) the machine will perform a hard shutdown, ie: simply kill power.
 
Old 02-07-2013, 10:57 PM   #9
ptbusiness
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
This is confusing. When I used linux before, I thought there was an icon that you can click if you want to shut down without logging in. Guess I was wrong.
 
Old 02-07-2013, 11:15 PM   #10
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
The OP stated he wants to shutdown from the terminal login prompt, not from a graphical login manager.

If you are on the graphical manager screen (GDM, LightDM etc), you can click on the power icon and select the appropriate menu item to shutdown, restart etc.
 
Old 02-07-2013, 11:34 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
On Centos gui that would be System menu, but as above, the OP asked for a cli soln.
 
Old 02-08-2013, 12:00 AM   #12
towheedm
Member
 
Registered: Sep 2011
Location: Trinidad & Tobago
Distribution: Debian Jessie
Posts: 592

Rep: Reputation: 119Reputation: 119
Ah yes, and there's the Magic SysRq key. If enabled, <Alt> + <SysRq> +:
E - terminate all processes
S - Sync drives
U - remount filesystems ro
O - Shutdown the system, or
B - Reboot the system
 
Old 02-08-2013, 12:28 AM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,822

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
The OP has stated two things
Quote:
how do I shutdown my linux machine at terminal login prompt?
you do not , you login as root in the TEXT ONLY terminal ( on GUI , text ONLY )
then type in the command
Code:
shutdown -h now
Quote:
i am still confused. when it asks for my login, what do i put for that?
your normal user name ( then hit <enter> )then your normal user password ( then hit <enter> )
both of these you set up during the install
you also ( depending on this unnamed operating system) created a "root" account with a
different password than the one you used for the FIRST normal user account

--- the above is for the TERMINAL ONLY login
NOT for the GUI login

Last edited by John VV; 02-08-2013 at 12:30 AM.
 
1 members found this post helpful.
  


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
cant login locally keep getting login prompt over and over on redhat linux 5.4 sankarm72 Linux - Newbie 8 04-03-2012 01:06 AM
When power is reset Linux server sits at login prompt, want this to login automatical jenniekingsland Linux - Newbie 1 09-07-2010 08:29 AM
terminal prompt different from console prompt dh2k Slackware 5 03-29-2010 05:38 PM
vsftpd login locally, but not remotely. get a login prompt though! ajkett Linux - Server 0 02-22-2007 05:18 AM
no prompt in terminal xyfan Linux - Newbie 1 12-06-2003 12:25 AM


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