5

I need to start by stating that I have read through every single problem on here relating to mine, but all of them seem to have access somehow to their server's files. I do not, so here is my question.

I'm on centOS 6.5 and ssh closes connection right after a successful login. I am using mac and windows/putty to access my server with the same results. Is there anyway I can access my server now without having access to its files?

Below is the readout from ssh -vvv right after a successful login:

debug1: Authentication succeeded (password).
Authenticated to 4X.5X.XX.2 ([4X.5X.XX.2]:82).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug3: Ignored env TERM_PROGRAM
debug3: Ignored env SHELL
debug3: Ignored env TERM
debug3: Ignored env TMPDIR
debug3: Ignored env Apple_PubSub_Socket_Render
debug3: Ignored env TERM_PROGRAM_VERSION
debug3: Ignored env TERM_SESSION_ID
debug3: Ignored env USER
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env __CF_USER_TEXT_ENCODING
debug3: Ignored env PATH
debug3: Ignored env PWD
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env XPC_FLAGS
debug3: Ignored env XPC_SERVICE_NAME
debug3: Ignored env SHLVL
debug3: Ignored env HOME
debug3: Ignored env LOGNAME
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Wed Oct  7 06:23:21 2015 from 1XX.XXX.X1.185
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 fd -1/-1 cc -1)

Connection to 4X.5X.XX.2 closed.
Transferred: sent 3176, received 2640 bytes, in 0.3 seconds
Bytes per second: sent 10370.6, received 8620.4
debug1: Exit status 254
4
  • What do you mean by "without having access to its files"? You can't access the server to debug? Oct 7, 2015 at 13:50
  • do you have server error log?
    – Jakuje
    Oct 7, 2015 at 15:51
  • No, no access at all. No server logs.
    – Conserta
    Oct 7, 2015 at 20:32
  • Thank you very much for the time you spent looking at my problem. I have reinstalled the server.
    – Conserta
    Oct 8, 2015 at 11:27

2 Answers 2

5

For the record this was certainly a problem forking the user shell. Those can be caused by:

  1. a problem in shell initialization files
  2. an out of memory condition
  3. 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.

1
  • 1
    thank you so much. I could login with this command in windows 10 ssh localhost cmd Feb 24, 2020 at 11:37
5

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
4
  • Good one. Thanks! Regarding /etc/security/limits.conf, one issue could be maxlogins set to 1, when you're trying to use scp, while logged in via ssh, with a same user. Basically, with value set to 1, you can have just one login session running, and not 2 (scp).
    – ivanleoncz
    Apr 9, 2020 at 2:33
  • After I change the limits.conf, I can not change it back :( When use sudo, there will be an error: sudo: pam_open_session: Permission denied May 26, 2020 at 14:42
  • Might be you do not have option to change it. Try doing it using root user. May 28, 2020 at 15:11
  • I have the same issue but now I can't login to my VM even not as root user.
    – DiDebru
    Dec 7, 2022 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .