Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Ubuntu 10.04 installation. When I open terminal, tab key works fine e.g. i type "apt-get install mysql" then press tab and see all options. But when I connect via ssh - tab key works only before first space. So it will do nothing in above example. I tried connect with different clients (ssh, putty, etc), and always same behavior.

My question is: how to make tab key work properly? Is problem in server or client?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The proper question isn't "how to make the tab key work properly?". It should be "how can I make the tab key work on my remote session the same way it works on my local machine?"

What you're used to seeing on your local machine is something that Ubuntu bakes into its installation of bash called bash completion. This uses the programmable tab completion options of bash to add tab completion to other commands. On its own, bash (and most other shells) simply provide file name and path completion.

When you're connecting to another machine using ssh, it isn't ssh which is causing the problem but instead it's the shell you're using on the remote machine -- also probably bash, but probably without the extra tab completion stuff.

On the remote machine, look for /etc/bash_completion, if it's there, you can load it into your current shell by typing (or putting into a startup file):

. /etc/bash_completion

If it isn't there, download one of the files from official site and install as instructed on the remote machine.

share|improve this answer
    
thx, it helps: "sudo apt-get install bash-completion", then some modifying files, and it start working like a charm :) –  Konstantin Dec 30 '10 at 20:23
    
Actually the only change need to be done is: /etc/ssh/ssh_config change HashKnownHosts to No. –  Konstantin Jan 5 '11 at 9:39

If you are using another account for SSHing, Another check is that, make sure your account in remote account is set to bash instead of sh. which of course, do not offer much for a shell.

share|improve this answer

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.