0

I've installed bash-completion-20060301-1 which gives auto completion of remove directories when using scp. The problem is that we have many servers that use ssh via port 26. How can I modify the completion in order for it to note if a -P26 was specified in the scp command line?

Thanks!

Maxim_united
  • 1,911
  • 1
  • 14
  • 23

1 Answers1

0

This will work if you add such servers to your ssh_config, i.e. usually ~/.ssh/config.

Host weirdbox
    User maxim
    Hostname 10.9.8.7
    Port 26

Tab completing scp weirdbox: will Just Work then.

Felix Frank
  • 8,125
  • 1
  • 23
  • 30
  • Thanks. But I'd like to avoid setting up all the hosts in the ssh_config. There's just too many to count... – Maxim_united Jun 26 '14 at 09:57
  • I encourage you to make a point of maintaining the `ssh_config` through some kind of script in that case (and likely distribute it through your network). It can potentially help you implement other helpful things for your day-to-day `ssh` use. – Felix Frank Jun 26 '14 at 11:37
  • I'll consider that, but I'd still like to know how to do my original question. – Maxim_united Jun 26 '14 at 15:11