SSH connection killed by Tab key


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH connection killed by Tab key
# 1  
Old 04-05-2017
SSH connection killed by Tab key

Hello,
I have a very weird problem with my ssh connection. After I log on the server for a while, when I wanted to change directory by pressing Tab key to save some typing, my connection to the server is lost!

First I checked my bash-completion setting, which I could not find any problem with, as I use exactly the same setting with my other severs with exactly the same OS (Debian, Linux server1 3.10-1-amd64 #1 SMP Debian 3.10.3-1 (2013-07-27) x86_64 GNU/Linux), where I do not have this problem.

I then checked my shell environment, which is bash for both my default and current shell.

It might be related to my ssh connection configuration on time-out settings, but my ssh connection settings are the same for the other servers. Any help would be greatly appreciated.
# 2  
Old 04-05-2017
Hi,

Hmm, that is odd. OK, first question: does this happen no matter whereabouts in the filesystem you are ? In other words, does tab completion only disconnect you if you try to use it in one particular place (a sub-directory of your home directory, say), or does it happen even if you're somewhere else, like / or /tmp, say ?
# 3  
Old 04-05-2017
Any directory, but I never worked in / though.
# 4  
Old 04-05-2017
Hi,

OK, thanks. It could be that for some reason Bash is segfaulting or otherwise crashing when it tries to do tab completion. To check that, try the following.
  1. Log in as usual
  2. Once you're logged in, type bash to start a sub-shell
  3. Type echo $SHLVL to see your current shell level
  4. Try to do tab completion. You'll probably end up back at a Bash prompt right away
  5. Do echo $SHLVL again. If the number has gone down by one, then that's what's happening - Bash is crashing on tab completion attempts

Anyway, just a thought - this might at least tell us if it's Bash that's dying, or if something else is going on.

Last edited by drysdalk; 04-05-2017 at 02:58 PM..
This User Gave Thanks to drysdalk For This Post:
# 5  
Old 04-05-2017
On the remote box only:

Add this to your ~/.bash_profile, ~/.bash_login, or ~/.profile on the remote box:

Code:
# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

# 6  
Old 04-05-2017
Thanks!
Code:
3. Type echo $SHLVL to see your current shell level
$> 2

 4. Try to do tab completion.  You'll probably end up back at a Bash prompt right away
$> (That did not happen, and nothing seemed wrong!)

5. Do echo $SHLVL again.  If the number has gone down by one, then that's what's happening - Bash is crashing on tab completion attempts
$> 

I did not see anything abnormal following to your instruction.
By the way, I should mentioned that Tab completion problem did NOT happen every time I press the Tab key, but only after certain period of time once I'm logged in, that's why I said it might be related to time-out setting. I did not measure how long that period is either.

---------- Post updated at 03:49 PM ---------- Previous update was at 03:45 PM ----------

Thanks Jim:
I have those lines in my ~/.bashrc. Do I have to put them into any of those files you mentioned?
# 7  
Old 04-05-2017
Are you inactive for a while before trying the TAB?

Perhaps its an SSH timeout you could try ServerAliveInterval 120 in your client ~/.ssh/config to send a NULL packet every 120 seconds to avoid timeout disconnects.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Match tab-delimited files based on key

I thought I had this figured out but was wrong so am humbly asking for help. The task is to add an additional column to FILE 1 based on records in FILE 2. The key is in COLUMN 1 for FILE 1 and in COLUMN 1 OR COLUMN 2 for FILE 2. I want to add the third column from FILE 2 to the beginning of... (8 Replies)
Discussion started by: andmal
8 Replies

2. Shell Programming and Scripting

Reading user input...problem with tab key

Hi all, I have a little problem with my shell script (reading user input, save user input to variable, invisible characters in the log file :() printf "1. What's your file path?" /path/to/my/file read -e FILE I have invisible characters in my log file (e.g. <ESC> or ^G) when I'm... (3 Replies)
Discussion started by: splendid
3 Replies

3. Solaris

Solaris how to enable auto tab key?

Hi, On Solaris 10, how do I enable the auto tab key? For example, on the Linux, I can type few letters and press the tab key. How do I do the same on Solaris? Thanks. (2 Replies)
Discussion started by: samnyc
2 Replies

4. UNIX for Advanced & Expert Users

How keep running a program n an another computer via a connection ssh when the connection is closed?

Hi everybody, I am running a program on a supercomputer via my personal computer through a ssh connection. My program take more than a day to run, so when I left work with my PC I stop the connection with the supercomputer and the program stop. I am wondering if someone know how I can manage... (2 Replies)
Discussion started by: TomTomGre
2 Replies

5. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

6. HP-UX

Tab key and History

Hi, I'm newbie with HP-UX. My Unix install with DB Oracle. In linux, when we type directory we don't need to type full. We can use Tab key. In Unix, i cannot use Tab key and i need to write whole directory. Other thing, how use Arrow key in Unix? I mean use command already i type. Is it... (1 Reply)
Discussion started by: mzainal
1 Replies

7. UNIX for Dummies Questions & Answers

TAB key in AIX

Hi, I want to use the TAB key to list directory (or go to directory or file). For example, dir1/dir2/file1 now if i do $ cd /d and hit TAB it should go to 'dir1'. Thanks (1 Reply)
Discussion started by: welldone
1 Replies

8. Shell Programming and Scripting

Using ssh to add register key on ssh server

Hi, I want to use ssh to add a register key on remote ssh server. Since there are space characters in my register key string, it always failed. If there is no space characters in the string, it worked fine. The following is what I have tried. It seems that "ssh" command doesn't care about double... (9 Replies)
Discussion started by: leaftree
9 Replies

9. Shell Programming and Scripting

Tab key in a script

Hi, How do I execute/emulate the <Tab> keypress from within a script? Any pointers will be helpful. Thanks (4 Replies)
Discussion started by: innocentspirit
4 Replies

10. Shell Programming and Scripting

TAB key

hi, :) When i press TAB key twice at $ prompt i am getting the following mesage "Display all 3797 possibilities? (y or n)" could u pls tell me the meaning of this message. cheers RRK (1 Reply)
Discussion started by: ravi raj kumar
1 Replies
Login or Register to Ask a Question