将 ulimit 设置为 unlimited 后,我无法登录机器

将 ulimit 设置为 unlimited 后,我无法登录机器

在其中一个要求中,我必须将我的其中一台机器的 ulimit 设置为无限制。

为此,我在 /etc/security/limits.conf 中进行了如下更改

# End of file
oracle   soft   nofile    unlimited
oracle   hard   nofile    unlimited
oracle   soft   nproc    131072
oracle   hard   nproc    131072
oracle   soft   core    unlimited
oracle   hard   core    unlimited
oracle   soft   memlock    50000000
oracle   hard   memlock    50000000

*           soft    nofile          unlimited
*           hard    nofile          unlimited

并修改了 /etc/profile

if [ $USER = "oracle" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
              ulimit -p unlimited
              ulimit -n unlimited
        else
              ulimit -u unlimited -n unlimited
        fi
fi

我退出了。我根本无法连接机器。你能帮我一下吗?

答案1

如果问题出在/etc/profile您所做的编辑上,并且假设您正在使用ssh连接,您可以尝试:

ssh youruser@yourhost bash --noprofile

bash不会加载全局或用户特定的启动文件(所以你甚至不会设置变量PS1,它看起来很奇怪)。

(我不知道如何使用 Ksh 来实现这一点。)

相关内容