Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Very newbie question!

I'm sshing to two different servers, both part of the same Amazon AWS cluster. They're not run by me.

On one ssh session, the terminal lets me autocomplete. On the other session, it doesn't - I wish it did.

Why is this - is it an option set by the server administrator?

And can I do anything about it?

thanks!

share|improve this question
add comment

migrated from stackoverflow.com Oct 30 '10 at 0:11

This question came from our site for professional and enthusiast programmers.

3 Answers

This isn't really a programming question, but it has to do with your shell. You can try starting the bash shell (by typing bash at the prompt) and see if you can autocomplete.

If that works you can use which bash to verify it's location and then chsh -s /bin/bash to set your shell permanently.

A list of available shells can also be found in /etc/shells.

share|improve this answer
add comment

It is a combination of the shell that is being used in your ssh session as well as it's configuration.

While your shell may support autocompletion it may not be configured for it. If you're using the bash shell, you can edit your local .bashrc file for the following to provide autocomplete.

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi
share|improve this answer
1  
The bash completion package is only needed for more advanced completion of things like command line options, server names, VCS repository directories, ... . Completion of commands, directories, file names, variables and user names works without it. –  ak2 Oct 30 '10 at 8:52
add comment

IIRC it could also be an issue that ssh hashes the hostnames in ~/.ssh/known_hosts

most installations I know use ~/.ssh/known_hosts as source for the list of available hosts for completion but some systems also started to set "HashKnownHosts yes", which prohibits using known_hosts as a source....

if your known hosts lines start with something like

|1|BWO5qDxk/cFH0wa05JLdHn+j6xQ=|rXQvIxh5cDD3C4

then hashing is activated.

share|improve this answer
add comment

Your Answer

 
discard

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