Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have read through the various posts for this problem and I can verify that using a -t when performing a remote ssh command does indeed force tty allocation and allow for command completion. However, the problem I am having is that twelve hours prior to this point I had trouble free access to this server. Now, with no known changes, I can no longer connect.

I can login to this server all day long without a problem. However, when I try to execute a remote command, say ssh servername 'ls /var/tmp', the connection disconnects without a logged error on the server.

So, what changed?

Here is my git config:

wwwin-svn-sjc:142> git config --list
receive.denynonfastforwards=false
user.name=joericks
user.email=joericks@cisco.com
http.postbuffer=52428800000

I bumped my http.postbuffer to an obscene level to eliminate that as a potential problem. I can switch to another account and clone these repositories from this server using the exact same URLs without a problem. Other admins and users are unaffected as well. When local to the server and using the problem account, I can add, commit and push to remote servers all day long without a problem.

Outside of Git I can force remote ssh commands to complete using ssh -t but that is really a work around and my users just won't accept a work around if I can't tell them why / how this happens or what caused it. I blew away my .ssh config settings and ssh keys. Attempting to clone without the keys brought up the requisite password prompt and the same failure.

I verified that permissions were sane for the .ssh files and parent directories:

> ls -alrt  
total 712  
-rw-r--r--  1     58 Sep 15 17:02 config  
-rw-r--r--  1 681826 Mar  7 12:24 known_hosts  
-rw-------  1   1675 Mar  7 15:22 id_rsa  
-rw-r--r--  1    405 Mar  7 15:22 id_rsa.pub  
drwx------  2   4096 Mar  7 15:23 .  
-rw-r--r--  1    405 Mar  7 15:23 authorized_keys  
drwxr-xr-x 78  24576 Mar  7 15:25 ..  

I have purposely kept my ssh config as simple as possible:

>cat config  
ForwardX11 yes   
ForwardAgent yes  
StrictHostKeyChecking no  

Using ssh -vvv I come back with this output. (truncated for brevity)

A dropped connection to the problematic server:

debug2: channel 0: open confirm rwindow 0 rmax 32768  
debug2: channel 0: rcvd adjust 2097152  
debug2: channel_input_status_confirm: type 99 id 0  
debug2: exec request accepted on channel 0  
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  

A good call to a functional server:

debug3: packet_send2: adding 48 (len 67 padlen 13 extra_pad 64)  
debug2: we sent a password packet, wait for reply  
debug1: Authentication succeeded (password).  
debug1: channel 0: new [client-session]  
debug3: ssh_session2_open: channel_new: 0  
debug2: channel 0: send open  
debug1: Entering interactive session.  
debug2: callback start  
debug2: client_session2_setup: id 0  
debug1: Sending command: ls  
debug2: channel 0: request exec confirm 1  
debug2: fd 3 setting TCP_NODELAY  
debug2: callback done  
debug2: channel 0: open confirm rwindow 0 rmax 32768  
debug2: channel 0: rcvd adjust 2097152  
debug2: channel_input_status_confirm: type 99 id 0  
debug2: exec request accepted on channel 0  
11:43  

At this point I am really at a loss and unfortunately I have at least one other user that is encountering this same issue. Has anyone ever figured out what exactly causes this problem (tty allocation fails unless expressly forced) and short of a knee jerk reboot of the system found a fix to correct the problem?

Jon

share|improve this question
add comment

1 Answer

An admin much smarter than I found the solution. Change the following line in your .bashrc file from:

[ $FULLENV != "true" ] && [ -z "$PS1" ] && exit

to

[ $FULLENV != "true" ] && [ -z "$PS1" ] && return
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.3.14.1460\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nos"], "copyright__copyright__copyright": ["lem?\n\nJon\n\nshare|improve this question\nadd comment\n\n1 Answer\n\nAn admin much smarter than I found the solution. Change the following line in your .bashrc file from:\n\n[ $FULLENV != \"true\" ] && [ -z \"$PS1\" ] && exit\n\nto\n\n[ $FULLENV != \"true\" ] && [ -z \"$PS1\" ] && return\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}