title: Cannot stop Jupyter Notebook
body: <p>I'm running Jupyter Notebook on a remote machine where I have a password-protected account. If I run:</p>
  
  <pre><code>jupyter-notebook list
  </code></pre>
  
  <p>i'm told that a jupyter notebook is running at localhost:p, where p is the port. In my case, p=8890. This is fine. However, when I run:</p>
  
  <pre><code>jupyter-notebook stop 8890
  </code></pre>
  
  <p>I get the following errors:</p>
  
  <pre><code>Shutting down server on port 8890 ...
  Traceback (most recent call last):
    File "/usr/local/bin/jupyter-notebook", line 11, in &lt;module&gt;
      sys.exit(main())
    File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 266, in launch_instance
      return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/traitlets/config/application.py", line 658, in launch_instance
      app.start()
    File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 1571, in start
      super(NotebookApp, self).start()
    File "/usr/local/lib/python2.7/dist-packages/jupyter_core/application.py", line 255, in start
      self.subapp.start()
    File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 451, in start
      if not self.shutdown_server(server):
    File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 442, in shutdown_server
      return shutdown_server(server, log=self.log)
    File "/usr/local/lib/python2.7/dist-packages/notebook/notebookapp.py", line 402, in shutdown_server
      HTTPClient().fetch(req)
    File "/usr/local/lib/python2.7/dist-packages/tornado/httpclient.py", line 102, in fetch
      self._async_client.fetch, request, **kwargs))
    File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 458, in run_sync
      return future_cell[0].result()
    File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 238, in result
      raise_exc_info(self._exc_info)
    File "&lt;string&gt;", line 3, in raise_exc_info
  tornado.httpclient.HTTPError: HTTP 403: Forbidden
  </code></pre>
  
  <p>I know that I could stop the notebook by killing the corresponding process using kill -9, but that's not really the solution I'm looking for. Any ideas on what could cause this issue?</p>
  
  <p>EDIT: As requested by @Ereli, I report the output of <code>netstat -apn | grep 8890</code> (unfortunately I don't have super user rights on the machine, so the sudo part is missing)</p>
  
  <pre><code>(Not all processes could be identified, non-owned process info
   will not be shown, you would have to be root to see it all.)
  tcp        0      0 127.0.0.1:8890          0.0.0.0:*               LISTEN      169484/python   
  tcp6       0      0 ::1:8890                :::*                    LISTEN      169484/python   
  tcp6       0      0 ::1:50356               ::1:8890                ESTABLISHED -               
  tcp6       0      0 ::1:50350               ::1:8890                ESTABLISHED -               
  tcp6       0      0 ::1:8890                ::1:50356               ESTABLISHED 169484/python   
  tcp6       0      0 ::1:8890                ::1:50350               ESTABLISHED 169484/python   
  unix  2      [ ACC ]     STREAM     LISTENING     188903661 -                   /tmp/.java_pid153259.tmp
  unix  2      [ ACC ]     STREAM     LISTENING     188904811 -                   /tmp/.java_pid153255.tmp
  unix  2      [ ACC ]     STREAM     LISTENING     188906806 -                   /tmp/.java_pid153264.tmp
  unix  2      [ ACC ]     STREAM     LISTENING     188904830 -                   /tmp/.java_pid153261.tmp
  unix  2      [ ]         STREAM     CONNECTED     188902981 -                   
  unix  2      [ ]         STREAM     CONNECTED     188906810 -                   
  unix  2      [ ]         STREAM     CONNECTED     188904833 -  
  </code></pre>