title: Which is the most gentle way to end a ssh session
body: <p>So far, I already know there are many ways to end a ssh session and disconnect from remote server. Assume under the environment of bash.</p>
  
  <ul>
  <li><p>Bash built-in command exit</p>
  
  <p><code>$ exit</code></p></li>
  <li><p>Bash built-in command logout</p>
  
  <p><code>$ logout</code></p></li>
  <li>Keyboard shortcut Control + D</li>
  <li><p>External command <code>fuser</code></p>
  
  <p><code>$ fuser -k /dev/pts/[n]</code></p></li>
  <li>Get sshd process id for current user then kill this process</li>
  </ul>
  
  <p>Can anyone explain what's the difference between these commands? Personally Ctrl + D is my favorite one, because it's the fastest one.</p>