Python Jupyter笔记本电脑可以';无法读取ssl证书文件

Python Jupyter笔记本电脑可以';无法读取ssl证书文件,python,jupyter-notebook,Python,Jupyter Notebook,我已经安装并配置了jupyter笔记本作为公共服务器运行(使用密码)。当我运行jupyter notebook时,它告诉我fullchain.pem文件不存在 (jupyter) rootadmin@ubuntu12:~/opensurfaces$ jupyter notebook Traceback (most recent call last): File "/home/rootadmin/opensurfaces/jupyter/bin/jupyter-notebook", line

我已经安装并配置了jupyter笔记本作为公共服务器运行(使用密码)。当我运行
jupyter notebook
时,它告诉我
fullchain.pem
文件不存在

(jupyter) rootadmin@ubuntu12:~/opensurfaces$ jupyter notebook
Traceback (most recent call last):
  File "/home/rootadmin/opensurfaces/jupyter/bin/jupyter-notebook", line 8, in <module>
    sys.exit(main())
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 663, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1769, in initialize
    self.init_webapp()
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1485, in init_webapp
    max_buffer_size=self.max_buffer_size)
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/tornado/util.py", line 286, in __new__
    instance.initialize(*args, **init_kwargs)
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/tornado/httpserver.py", line 191, in initialize
    read_chunk_size=chunk_size,
  File "/home/rootadmin/opensurfaces/jupyter/lib/python3.6/site-packages/tornado/tcpserver.py", line 134, in __init__
    'certfile "%s" does not exist' % self.ssl_options["certfile"]
ValueError: certfile "/etc/letsencrypt/live/my_website_url/fullchain.pem" does not exist
该文件(在该确切位置)具有以下权限

(jupyter) rootadmin@ubuntu12:/etc/letsencrypt/live/my_website_url$ ls -l
total 4
lrwxrwxrwx 1 root root       49 Mar 12 12:26 cert.pem -> ../../archive/my_website_url/cert9.pem
lrwxrwxrwx 1 root root       50 Mar 12 12:26 chain.pem -> ../../archive/my_website_url/chain9.pem
lrwxrwxrwx 1 root root       54 Mar 12 12:26 fullchain.pem -> ../../archive/my_website_url/fullchain9.pem
lrwxrwxrwx 1 root root       52 Mar 12 12:26 privkey.pem -> ../../archive/my_website_url/privkey9.pem
我不能用我的用户读取文件(例如
nano fullchain.pem
),但我可以用
sudo nano
读取。我想我可以将文件复制到jupyter可以读取的位置,但这似乎有点愚蠢

我怎样才能使jupyter笔记本工作


编辑:如果我确实只是简单地将证书文件复制到另一个位置,那么它似乎可以工作。然后我遇到了一个不同的,我想,不相关的问题。我提出了一个关于

的单独问题,您是否尝试过使用
chmod 400/etc/letsencrypt/live/my_website\u url/fullchain.pem来限制该文件的权限?是的,但现在我更仔细地看了一下,
chmod
似乎根本没有改变权限。400755500它实际上没有更改?这些是符号链接,因此您没有显示实际权限。使用
ls
-L
选项取消对符号链接的引用。@jordanm谢谢。使用
-L
我看到它发生了变化。但错误仍然存在。您也可以尝试直接指向证书的路径,而不是符号链接,以确定这是否是问题所在。如果符号链接由于某种原因没有指向正确的位置,那么
os.path.exists
将返回
False
,这就是tornado出错时所做的:
(jupyter) rootadmin@ubuntu12:/etc/letsencrypt/live/my_website_url$ ls -l
total 4
lrwxrwxrwx 1 root root       49 Mar 12 12:26 cert.pem -> ../../archive/my_website_url/cert9.pem
lrwxrwxrwx 1 root root       50 Mar 12 12:26 chain.pem -> ../../archive/my_website_url/chain9.pem
lrwxrwxrwx 1 root root       54 Mar 12 12:26 fullchain.pem -> ../../archive/my_website_url/fullchain9.pem
lrwxrwxrwx 1 root root       52 Mar 12 12:26 privkey.pem -> ../../archive/my_website_url/privkey9.pem