请教高手关于Ubuntu sudo文件数的问题

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
karlzheng
帖子: 26
注册时间: 2008-12-11 0:42

请教高手关于Ubuntu sudo文件数的问题

#1

帖子 karlzheng » 2009-10-26 9:49

我用Ubuntu在/etc/security/limits.conf 加入了 * - nofile 65536 使所有的用户具有64K的最大文件打开数
现在有一个问题
如下:
root@ub:/home/test# su root -c "ulimit -n"
65536
root@ub:/home/test# sudo su root -c "ulimit -n"
1024
root@ub:/home/test#
请教:怎么使sudo执行时,所有用户也有65536个文件打开数的权限?可以在哪里配置?
t3swing
帖子: 1028
注册时间: 2008-11-01 21:42
来自: 树下板凳

Re: 请教高手关于Ubuntu sudo文件数的问题

#2

帖子 t3swing » 2009-10-26 11:06

root+sudo+su晕了
最大文件打开数 更晕
呼唤大牛.....
民族的脊梁,是踏实做事的人,非只知道骂街的泼妇。
karlzheng
帖子: 26
注册时间: 2008-12-11 0:42

Re: 请教高手关于Ubuntu sudo文件数的问题

#3

帖子 karlzheng » 2009-10-26 13:17

t3swing 写了:root+sudo+su晕了
最大文件打开数 更晕
呼唤大牛.....
没什么啊。。。说到底就是sudo的环境而已,其实也可以不用root用户试的。。。
test@sw:~$ ulimit -n
65536
test@sw:~$ sudo su -c "ulimit -n"
1024
test@sw:~$
karlzheng
帖子: 26
注册时间: 2008-12-11 0:42

Re: 请教高手关于Ubuntu sudo文件数的问题

#4

帖子 karlzheng » 2009-10-27 18:35

请高手进来说说
jelly_sh
帖子: 54
注册时间: 2009-09-09 10:14

Re: 请教高手关于Ubuntu sudo文件数的问题

#5

帖子 jelly_sh » 2009-11-02 17:32

following steps :
1) vim /etc/security/limits.conf
添加:
* soft nofile 65535
* hard nofile 65535

2) vim /etc/pam.d/login
添加:
session required /lib/security/pam_limits.so

3)reboot

Last check it , good luck!
回复