LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2008, 06:26 AM   #1
lchxr
Member
 
Registered: Mar 2006
Posts: 42

Rep: Reputation: 15
Remote shutdown via ssh frozen the local console


I logged into the remote computer via 'ssh root@<remoteIP>' and when typing the root password, I got the '#' prompt. Then I typed in a console 'shutdown -h now', the remote computer was really shutdown, but my local console was frozen (I am using a text console). I had to 'Ctrl+Alt+F2' to switch to another terminal to continue my work. Does anyone know how to fix this problem?
 
Old 11-08-2008, 06:40 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
ssh was probably still running.
You could have exited it with <CTRL>-c
 
Old 11-08-2008, 08:10 AM   #3
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 45
Sometimes this happens to me also... you can avoid the problem by scheduling the shutdown, in order to have enough time to logout before the shutdown begins (see the manpage of the shutdown command).
When the console is frozen, you can always find the associated ssh process and kill it with a -9 signal or another "violent" signal.
 
Old 11-08-2008, 10:02 AM   #4
lchxr
Member
 
Registered: Mar 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by tredegar View Post
ssh was probably still running.
You could have exited it with <CTRL>-c
No, <Ctrl>-C has no effect.
 
Old 11-08-2008, 10:08 AM   #5
lchxr
Member
 
Registered: Mar 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by clvic View Post
Sometimes this happens to me also... you can avoid the problem by scheduling the shutdown, in order to have enough time to logout before the shutdown begins (see the manpage of the shutdown command).
When the console is frozen, you can always find the associated ssh process and kill it with a -9 signal or another "violent" signal.
Thank you for you reply. It could have many solutions,but I want to know the reason. Sometimes it exited with "closed by remote session", sometimes it is frozen.
 
Old 11-08-2008, 01:55 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
My shutdowns close cleanly:
Code:
tred@vaio:~$ ssh server
tred@server:~$ sudo -i
Password:
root@server:~# shutdown -h now

Broadcast message from root@server (pts/1) (Sat Nov  8 19:51:03 2008):

The system is going down for system halt NOW!
root@server:~# Connection to server closed by remote host.
Connection to server closed.
tred@vaio:~$
My version of ssh is 1.4.7. Maybe you need to update yours?

And you should not have root logins by ssh enabled. Do it as I have done, above: First login as yourself, then gain root privileges. root logins should be DENIED to ssh

Last edited by tredegar; 11-08-2008 at 01:59 PM. Reason: Don't enable root logins
 
  


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
SSH to local console (tty) mastrboy Linux - General 6 01-15-2010 05:54 AM
How to configure ssh local / remote forwarding at parmanent label. linuxjamil Linux - Server 1 02-21-2008 06:26 AM
mounting local hard drive in a remote shell (SSH) noir911 Linux - General 1 06-24-2005 05:55 AM
Remote SSH login causing system shutdown stevey99 Linux - Networking 2 01-08-2005 03:14 PM
shutdown xserver via remote shell (ssh) ? timbaloo Linux - Newbie 1 07-07-2004 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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