PermissionError: [Errno 13] 访问 aws ec2 时权限被拒绝 [英] PermissionError: [Errno 13] Permission denied when accessing to aws ec2

查看:23
本文介绍了PermissionError: [Errno 13] 访问 aws ec2 时权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在虚拟机上运行 ubuntu 16.04(在 mac 上),在 aws ec2 ubuntu 18.04 上运行.我正在尝试在 aws.ec2 上运行 Jupiter notebook,并尝试通过本地 Ubuntu 上的网络浏览器远程访问它.我能够访问远程 ubuntu(aws.ec2) 终端.在我按照这个 链接

I have ubuntu 16.04 running on virtual box(on mac), and on aws ec2 ubuntu 18.04 running. I am trying to run Jupiter notebook on aws.ec2 and trying to access it remotely thru my web browser on my local Ubuntu. I am able to access remote ubuntu(aws.ec2) terminal. After I followed the steps on this link

我在第 9 步中遇到以下错误.

I got the following error on the step 9.

我从头开始重新安装了 3 次(包括本地 ubuntu 和 aws ec2 实例),但到目前为止没有任何进展.

I reinstalled everything from scratch 3 times(including local ubuntu and aws ec2 instance), but no progress so far.

Last login: Thu Nov  1 06:34:07 2018 from 134.1****
ubuntu@ip-172-***:~$ export XDG_RUNTIME_DIR=""
ubuntu@ip-172-***:~$ jupyter notebook
[I 06:40:19.525 NotebookApp] Serving notebooks from local directory: /home/ubuntu
[I 06:40:19.528 NotebookApp] The Jupyter Notebook is running at:
[I 06:40:19.528 NotebookApp] https:// **** :8888/?token=727fbb120d19f55a435c1*****
[I 06:40:19.528 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 06:40:19.529 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        https://(ip-172-31-***** .0.1):8888/?token=727fbb120d19f55a435c14*********
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(4, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(4, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 122, in _handle_events
    handler_func(fileobj, events)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 262, in accept_handler
    callback(connection, address)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/tcpserver.py", line 263, in _handle_connection
    do_handshake_on_connect=False)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 565, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 540, in ssl_options_to_context
    context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
PermissionError: [Errno 13] Permission denied
ERROR:asyncio:Exception in callback BaseAsyncIOLoop._handle_events(4, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(4, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 122, in _handle_events
    handler_func(fileobj, events)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 262, in accept_handler
    callback(connection, address)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/tcpserver.py", line 263, in _handle_connection
    do_handshake_on_connect=False)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 565, in ssl_wrap_socket
    context = ssl_options_to_context(ssl_options)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/tornado/netutil.py", line 540, in ssl_options_to_context
    context.load_cert_chain(ssl_options['certfile'], ssl_options.get('keyfile', None))
PermissionError: [Errno 13] Permission denied

注意1: 在 ec2 实例上,Ubuntu 有 18.04 版本,它带有 python 3.6.3 然后我必须在它上面安装 anaconda 然后 python 版本现在是 3.5.2 一次我输入了 $python3.

Note1: on ec2 instance, Ubuntu has 18.04 version and it came with python 3.6.3 then I have to install anaconda on the top of it and then the python version now is 3.5.2 once I typed $python3.

注意2:尽管在将anaconda安装到EC2之后python版本降级到3.5.2

Note2: Despite after the anaconda has been installed into the EC2 then the python version degraded to 3.5.2

一旦我检查了以下目录/usr/local/lib/只存在 python3.6 文件夹,然后我输入 $sudo chmod 777 dist-packages/

once I have checked the following directory /usr/local/lib/ there only python3.6 folder is existing, then I typed $sudo chmod 777 dist-packages/

然后$jupyter notebook,然后复制token链接并结合dns,还是不行.

then $jupyter notebook, then copy the token link and combine with dns, but still didn't worked.

推荐答案

我遇到了同样的问题,现在我只是通过尝试几件事来解决它.尝试这些解决方案,看看是否有帮助:

I had the same problem, and now I just solved it by trying a couple things. Try these solutions to see if it helps:

  1. /home 文件夹和 ~/.local/share/jupyter/ 文件夹的所有权更改为运行此命令的当前用户:
  1. Changed the ownership of the /home folder and ~/.local/share/jupyter/ folder to current user running this command:

   sudo chown -R $USER /home/

   sudo chown -R $USER ~/.local/share/jupyter/

  1. 如果您遇到 ssl 错误问题,请查看此链接.

确保在浏览器中输入 https:// 而不是 http://.

Make sure you type https://<jupyter-server-ip> in your browser instead of http://.

这篇关于PermissionError: [Errno 13] 访问 aws ec2 时权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆