简体   繁体   English

ping:套接字:不允许操作 Ubuntu docker 图像

[英]ping: socket: Operation not permitted Ubuntu docker image

Hi i am new to docker and linux.嗨,我是 docker 和 linux 的新手。 I am trying to ping a particular ip address from a python file in a container built on ubuntu 18.04 base.我正在尝试从基于 ubuntu 18.04 基础的容器中的 python 文件中 ping 特定的 ip 地址。

I get the following error when the container is ran on CentOS OS but it runs fine on Ubuntu OS当容器在 CentOS 操作系统上运行时出现以下错误,但在 Ubuntu 操作系统上运行良好

Error when container is ran on CentOS OS在 CentOS 操作系统上运行容器时出错

Ping runs fine when container is ran on Ubuntu OS当容器在 Ubuntu 操作系统上运行时,Ping 运行良好

The output for ls -lsa, sudo ping output 用于 ls -lsa, sudo ping

Any help would be appreciated.任何帮助,将不胜感激。 Thanks!谢谢!

The error sounds more like an access privilege issue and less like a network issue.该错误听起来更像是访问权限问题,而不是网络问题。 I'd problem solve by checking user prividges, to start can you ping CentOS using sudo and check the binary permissions.我会通过检查用户权限来解决问题,首先你可以使用 sudo ping CentOS 并检查二进制权限。

which ping
ls -lsa /bin/ping

I'd expect the middle section to contain an x (for execute), eg something like -rwxr-xr-x我希望中间部分包含一个 x (用于执行),例如 -rwxr-xr-x

and/or use sudo to confirm it's priviledge related:和/或使用 sudo 确认它与特权相关:

sudo ping 192.168.92.166

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM