LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Remote shutdown via ssh frozen the local console (https://www.linuxquestions.org/questions/linux-networking-3/remote-shutdown-via-ssh-frozen-the-local-console-681955/)

lchxr 11-08-2008 06:26 AM

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?

tredegar 11-08-2008 06:40 AM

ssh was probably still running.
You could have exited it with <CTRL>-c

clvic 11-08-2008 08:10 AM

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.

lchxr 11-08-2008 10:02 AM

Quote:

Originally Posted by tredegar (Post 3335258)
ssh was probably still running.
You could have exited it with <CTRL>-c

No, <Ctrl>-C has no effect.

lchxr 11-08-2008 10:08 AM

Quote:

Originally Posted by clvic (Post 3335308)
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.

tredegar 11-08-2008 01:55 PM

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


All times are GMT -5. The time now is 02:19 AM.