putty closing after successful login

0

On Linux box, As 'root' user, I changed the nproc and nofile limits (soft limit) as unlimited in "/etc/security/limits.d/90-nproc.conf" and "/etc/security/limits.conf". After that I am not able to login into server. When I try to login by putty, if I give correct password, the putty window just closes without any message. If I enter wrong password, it throws 'Incorrect password' message and prompts again for password.

Please let me know why it's getting closed as soon as I give correct password.

user3123752

Posted 2015-12-12T16:54:56.643

Reputation: 3

Answers

0

Since all those limits you have modified are applying on login you probably messed up one if those configs and now when you login the pam module will not allow you. Since we don't have more info I can only speculate what the problem is, it may be that nofile is higher then /proc/sys/fs/file-max or noproc higher than /proc/sys/kernel/pid_max

You are probably not going to be able to login until you fix these configs. You can try logging on the physical console(or KVM/ipmi) if you have access to one, but since these are probably global limits you won't be able to do so on the console too. You should give it a try anyway.

You may have to reboot in single user mode or even try passing init=/bin/bash kernel parameter in the bootloader to temporary obtain a shell and fix these files.

EvilTorbalan

Posted 2015-12-12T16:54:56.643

Reputation: 254

Thanks a lot for the reply. I will try that and update you – user3123752 – 2015-12-12T17:23:00.840

Well you should be very careful when meddling with pam, you can easily lock yourself out of the server. Its best to keep one open console and try logging on another so you can revert the changes in cases like this. – EvilTorbalan – 2015-12-12T17:30:42.463

After booting in single user mode and reverting the changes, we were able to login. We started some services and from then onwards all the users are getting Access Denied error. But if we try to login from UI like VMWare, we are able to login. Please advise. – user3123752 – 2015-12-14T13:02:55.947

'Access Denied'? what users? Is this related to the original problem and how? – EvilTorbalan – 2015-12-14T17:47:18.040

We reverted back all the changes and rebooted the linux server and now we are able to login. But we are still not sure on how to increase those parameters. Below are the settings I see when I login.

$ ulimit -a
open files                      (-n) 64000
max user processes              (-u) 64000
$ cat /proc/sys/fs/file-max
64000
$ cat /proc/sys/kernel/pid_max
32768

I doubt that pid_max should be always more than the settings done anywhere else. Can you confirm. – user3123752 – 2015-12-14T18:27:36.207

Try increasing pid_max by either echo 4194303 > /proc/sys/kernel/pid_max or sysctl -w kernel.pid_max= 4194303. To make the changes permanent write kernel.pid_max= 4194303 in /etc/sysctl.conf – EvilTorbalan – 2015-12-14T19:06:27.677

Cool what was it? – EvilTorbalan – 2015-12-15T20:25:14.693

We got pid max increased and also no. of open files increased in /proc/sys/fs/file-max and proc/sys/kernel/pid_max. And then increased in "/etc/security/limits.d/90-nproc.conf" and "/etc/security/limits.conf". – user3123752 – 2015-12-16T21:00:34.137