SSH closes connection after login Exit status 254
For the record this was certainly a problem forking the user shell. Those can be caused by:
- a problem in shell initialization files
- an out of memory condition
- an out of processes condition
This is a very late answer, but in this situation I would have tried executing a command directly, for example: ssh server ls -ltra
which could bypass some shell initialization, logging in as another user which would use some different shell initialization files, and then by rebooting, which should fix any out-of-resources condition.
I was changed the Open files configuration in kernel parameter file /etc/security/limits.conf to unlimited and lost the connectivity.
After reverting it back to the normal for root user i got the connectivity back.
Wrong Example:
## Example hard limit for max opened files
* hard nofile unlimited
root hard nofile unlimited
## Example soft limit for max opened files
* soft nofile unlimited
root soft nofile unlimited
Correct Ex:
## Example hard limit for max opened files
* hard nofile 16000
root hard nofile 16000
## Example soft limit for max opened files
* soft nofile 16000
root soft nofile 16000