在Linux发行版上如何对非root用户执行ping操作? [英] How is ping for non-root user implemented on Linux distros?

查看:434
本文介绍了在Linux发行版上如何对非root用户执行ping操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在浏览用于ping格式 iputils 软件包的代码.

我注意到 ping使用原始套接字 SOCK_RAW,任何用户空间应用程序都需要root特权才能使用.

I was browsing through the code for ping form iputils package for Linux.

I noticed that ping uses raw sockets SOCK_RAW, which any userspace application requires root privilege to use.

Linux发行版的开发人员如何管理为非root用户提供ping命令?

How do the developers of Linux distros manage to provide the ping command for non-root users ?

推荐答案

ping可执行文件是setuid根目录:

The ping executable is setuid root:

$ ls -l /bin/ping
-rwsr-xr-x 1 root root 35712 Nov  8  2011 /bin/ping

这篇关于在Linux发行版上如何对非root用户执行ping操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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