普通用户无法读取/proc/net/dev [英] regular user can't read /proc/net/dev

查看:511
本文介绍了普通用户无法读取/proc/net/dev的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定我在这里遗漏了一些东西,但是我不确定到底是什么:

I'm pretty sure that I'm missing something here, but I'm not sure exactly what:

这是root可以看到的:

This is what root can see:

root@opteron16:/# ls -l | grep proc
dr-xr-xr-x 290 root root     0 2012-01-14 02:03 proc
root@opteron16:/# ls -l proc | grep net
lrwxrwxrwx  1 root       root        8 2012-01-21 03:29 net -> self/net
root@opteron16:/# ls -l proc/net/ | grep dev
-r--r--r-- 1 root root 0 2012-01-14 02:05 dev

这是神经节用户:

root@opteron16:/# cat /etc/passwd | grep ganglia
ganglia:x:111:119:Ganglia Monitor:/var/lib/ganglia:/bin/false

当我尝试使用此用户访问/proc/net/dev时:

When I try to access /proc/net/dev with this user:

root@opteron16:/# su -s /bin/bash ganglia
ganglia@opteron16:/$ ls -l /proc | grep net
lrwxrwxrwx  1 root    root     8 2012-01-21 19:49 net -> self/net
ganglia@opteron16:/$ ls -l /proc/net/
ls: reading directory /proc/net/: Invalid argument
total 0
ganglia@opteron16:/$ cat /proc/net/dev
cat: /proc/net/dev: No such file or directory

很棒,不要感到这个愚蠢:).

Would be great to not feel this stupid : ).

这是我注意到的东西,以前我从未见过这样的行为:

This is something which I've noticed and I've never seen such a behaviour before:

root@opteron16:/proc# ls -l | grep "self -"
lrwxrwxrwx  1 root       root       64 2012-01-22 00:01 self -> 29095
root@opteron16:/proc# ls -l | grep "self -"
lrwxrwxrwx  1 root       root       64 2012-01-22 00:01 self -> 29097
root@opteron16:/proc# ls -l | grep "self -"
lrwxrwxrwx  1 root       root       64 2012-01-22 00:01 self -> 29099

推荐答案

最有可能的原因是您的内核已使用grsec编译.即

Most likely, this is due to your kernel that has been compiled with grsec. i.e.

$ uname -a
Linux xxxx 3.2.13-grsec-xxxx-grs-ipv6-64 #1 SMP Thu Mar 29 09:48:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

我已经看到这是在ovh托管的服务器上发生的,因为这是它们安装的默认内核,可让您通过其管理工具启用netboot.

I have seen this happen on servers hosted by ovh since this is the default kernel they install for you to enable netboot through their admin tools.

总而言之,您可以执行以下操作之一:

To summarize, you can do one of:

  1. 以超级用户身份运行程序(为安全性ovh为+1!)
  2. 在此框中安装默认的ubuntu内核
  3. 尖叫一会(我的最爱)

这篇关于普通用户无法读取/proc/net/dev的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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