Martin Paul Eve bio photo

Martin Paul Eve

Professor of Literature, Technology and Publishing at Birkbeck, University of London

Email Books Twitter Github Stackoverflow MLA CORE Institutional Repo Hypothes.is ORCID ID  ORCID iD Wikipedia Pictures for Re-Use

Currently, owing to a bug, scp in Kubuntu and Ubuntu 9.10 (Karmic Koala) does not allow you to autocomplete remote directories (when you have a passwordless ssh setup, obviously).

While I have submitted a patch for review, this will not be backported into 9.10 and so, those who wish to have this functionality, should follow these steps:

Visit this bug to read about the problem. Note that this is a problem with bash-completion, not with scp itself.

Download my fix: bash-completion scp fix for Ubuntu 9.10.

Backup your current file:

sudo cp /etc/bash_completion.d/ssh ~/ssh_backup

Copy the downloaded file to /etc/bash_completion.d/:

sudo cp ./ssh /etc/bash_completion.d/

Restart your bash session and you should have working scp remote completion! ie. scp remotehost:~/myfi[TAB] will complete to remotehost:/home/you/myfile.txt

Note: I am not responsible for any damage this causes - it is not an official patch and I am unable to provide tech support. If you find problems with the fix, please report them to the official bug posted above which is more likely to get a response.

If anything goes wrong, you can restore the old configuration using:

sudo cp ~/ssh_backup /etc/bash_completion.d/ssh