Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This happened many times.

While the SSH active, I'm so tired and just close the terminal without exit

Is it dangerous to doing like that?

share|improve this question
    
Simply hit Ctrl+D twice instead of Alt-F4 or Ctrl-Q, this sends the exit signal to your current ssh, then to your shell, and the terminal emulator should close automatically without shell. Problem solved. –  Profpatsch Mar 15 '13 at 11:00
    
@Profpatsch: unless, of course, you use IGNOREEOF (in bash) because you also use a terminal multiplexer and got tired of sometimes mistyping ^a d as ^d, thereby quitting unintentionally. –  0xC0000022L Mar 15 '13 at 13:02
add comment

2 Answers 2

up vote 22 down vote accepted

Not at all. When the terminal process exits, the client processes within will also die, and when this happens, the connection to the remote server will be closed by the operating system. The server will see the connection close, and terminate the processes on the server.

However, it is possible that you might end up with lingering processes on the server if they were backgrounded and ignore certain signals.

share|improve this answer
add comment

When we closes the terminal directly, It generates a SIGHUP signal. This signal kills all the tasks/processes under the terminal automatically/instantly. So no problem occurring.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.