首先需要编辑**/etc/security/limits.conf**文件(用户限制配置文件)
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
然后编辑**/etc/pam.d/login**文件 (将配置文件加入到登录验证模块)
Session required pam_limits.so
最后编辑**/etc/profile**文件(环境变量文件)
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
要使/etc/security/limits.conf 文件配置生效,必须要确保 PAM验证模块pam_limits.so
文件被加入到启动文件中。查看 /etc/pam.d/login 文件中有:
session required /lib/security/pam_limits.so
64位地址是:/lib64/security/pam_limits.so 否则本地即使输入正确密码也无法登陆。
参考网址
https://www.cnblogs.com/hftian/p/6944133.html
PAM的 验证模块,存放位置在/lib/security,如pam_limits.so、pam_group.so等
PAM验证模块的配置文件,存放位置
/etc/security中,如pam_limits.so验证模块对应的配置文件limits.conf,pam_group.so验证模块对应的配置文件group.conf。PAM验证模块和应用程序的对应关系,存放位置/etc/pam.d文件夹。通过修改此文件夹下的配置文件,可以为应用选定具体的验证模块