Bug 546905 - bash-completion not working for ssh in Fedora 12
Summary: bash-completion not working for ssh in Fedora 12
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 12
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-12 15:49 UTC by Armin
Modified: 2009-12-23 21:30 UTC (History)
3 users (show)

Fixed In Version: 1.1-4.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-23 21:30:15 UTC
Type: ---


Attachments (Terms of Use)

Description Armin 2009-12-12 15:49:17 UTC
Description of problem:
SSH completion for hosts mentioned in ~/.ssh/config is not working at all. When i manually install an old bash-completion RPM from 2006, everything works like expected.

Version-Release number of selected component (if applicable):
1:1.1-3.fc12

How reproducible:
define a host in ~/.ssh/config, enter a new shell session and try ssh hostn<TAB><TAB>

Steps to Reproduce:
1. install bash-completion from the repository first
2. use steps in "How reproducible"

  
Actual results:
it will complete nothing

Expected results:
it will complete to the defined host

Comment 1 Ville Skyttä 2009-12-12 22:48:57 UTC
The bug summary says bash completion is not working at all, but your report mentions only ssh hosts completion.  I'm assuming you mean the latter only and the bug summary should be adjusted?

Do you have any known hosts files?

Do a "set -x" in a shell, then try the completion, and post the resulting output here (make sure it doesn't contain any confidential information).

Comment 2 Armin 2009-12-14 00:09:06 UTC
Hi,

i'm not getting any output at all when i use set -x and try ssh hostn<TAB> or something. By the way, yes my bug summary was not very exact. Completion is working for e.g. yum wonderfully, just ssh completion does nothing. I have a ~/.ssh/known_hosts but i think what matters is that i have defined custom host definitions in ~/.ssh/config, whose names bash_completion usually completes.

Sorry for my faulty summary. Fixed it.

Thanks for your work,

- Armin

Comment 3 Ville Skyttä 2009-12-14 15:45:31 UTC
There is a bug in 1.1 (fixed upstream yesterday) where if there are no known hosts files, completions from ~/.ssh/config are not tried either.  But if you have one, that's not the issue here.

(In reply to comment #2)
> i'm not getting any output at all when i use set -x and try ssh hostn<TAB> or
> something.

That is very weird, but it also indicates that the ssh completion function from bash-completion has not been installed at all.  What do the following commands output?

rpm -V bash-completion

rpm -q openssh-clients

rpm -V openssh-clients

ls -la /usr/bin/ssh

ls -la /etc/bash_completion.d/

Comment 4 Armin 2009-12-14 23:22:15 UTC
Hi,
this is the output of those commands:


rpm -V bash-completion:
---
rpm -q openssh-clients:
openssh-clients-5.2p1-31.fc12.x86_64
---
rpm -V openssh-clients:
---
ls -la /usr/bin/ssh:
-rwxr-xr-x 1 root root 358376 2009-11-02 14:04 /usr/bin/ssh
---
ls -la /etc/bash_completion.d/:
total 64
drwxr-xr-x   2 root root  4096 2009-12-14 01:45 .
drwxr-xr-x 117 root root 12288 2009-12-14 23:55 ..
lrwxrwxrwx   1 root root    46 2009-12-13 15:34 acroread.sh -> /opt/Adobe/Reader9/Resource/Shell/acroread_tab
-rw-r--r--   1 root root  3340 2009-10-09 14:49 bash-builtins
lrwxrwxrwx   1 root root    37 2009-12-14 00:35 bind-utils -> /usr/share/bash-completion/bind-utils
lrwxrwxrwx   1 root root    37 2009-12-14 00:35 bittorrent -> /usr/share/bash-completion/bittorrent
lrwxrwxrwx   1 root root    32 2009-12-14 00:35 bzip2 -> /usr/share/bash-completion/bzip2
lrwxrwxrwx   1 root root    36 2009-12-14 00:35 chkconfig -> /usr/share/bash-completion/chkconfig
-rw-r--r--   1 root root   882 2009-10-09 14:49 configure
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 cpio -> /usr/share/bash-completion/cpio
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 cups -> /usr/share/bash-completion/cups
lrwxrwxrwx   1 root root    30 2009-12-14 00:35 cvs -> /usr/share/bash-completion/cvs
-rw-r--r--   1 root root   798 2009-10-09 14:49 dd
lrwxrwxrwx   1 root root    35 2009-12-14 00:35 dhclient -> /usr/share/bash-completion/dhclient
lrwxrwxrwx   1 root root    36 2009-12-14 00:35 findutils -> /usr/share/bash-completion/findutils
lrwxrwxrwx   1 root root    30 2009-12-14 01:45 gcc -> /usr/share/bash-completion/gcc
lrwxrwxrwx   1 root root    30 2009-12-14 00:35 gdb -> /usr/share/bash-completion/gdb
lrwxrwxrwx   1 root root    38 2009-12-14 00:35 genisoimage -> /usr/share/bash-completion/genisoimage
-rw-r--r--   1 root root  1374 2009-10-09 14:49 getent
lrwxrwxrwx   1 root root    34 2009-12-14 00:35 gkrellm -> /usr/share/bash-completion/gkrellm
-rw-r--r--   1 root root  2516 2009-11-30 15:52 gvfs-bash-completion.sh
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 gzip -> /usr/share/bash-completion/gzip
-rw-r--r--   1 root root   714 2009-10-09 14:49 iconv
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 info -> /usr/share/bash-completion/info
lrwxrwxrwx   1 root root    35 2009-12-14 00:35 iptables -> /usr/share/bash-completion/iptables
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 lftp -> /usr/share/bash-completion/lftp
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 make -> /usr/share/bash-completion/make
lrwxrwxrwx   1 root root    30 2009-12-14 00:35 man -> /usr/share/bash-completion/man
lrwxrwxrwx   1 root root    29 2009-12-14 00:35 mc -> /usr/share/bash-completion/mc
lrwxrwxrwx   1 root root    32 2009-12-14 00:35 mdadm -> /usr/share/bash-completion/mdadm
lrwxrwxrwx   1 root root    34 2009-12-14 00:35 mplayer -> /usr/share/bash-completion/mplayer
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 mutt -> /usr/share/bash-completion/mutt
lrwxrwxrwx   1 root root    36 2009-12-14 00:35 net-tools -> /usr/share/bash-completion/net-tools
lrwxrwxrwx   1 root root    34 2009-12-14 00:35 ntpdate -> /usr/share/bash-completion/ntpdate
lrwxrwxrwx   1 root root    35 2009-12-14 00:35 openldap -> /usr/share/bash-completion/openldap
lrwxrwxrwx   1 root root    34 2009-12-14 00:35 openssl -> /usr/share/bash-completion/openssl
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 perl -> /usr/share/bash-completion/perl
-rw-r--r--   1 root root  2574 2009-11-20 10:00 pk-completion.bash
lrwxrwxrwx   1 root root    33 2009-12-14 00:35 python -> /usr/share/bash-completion/python
-rw-r--r--   1 root root 10064 2009-10-09 14:49 rpm
lrwxrwxrwx   1 root root    32 2009-12-14 00:35 rsync -> /usr/share/bash-completion/rsync
lrwxrwxrwx   1 root root    30 2009-12-14 00:35 tar -> /usr/share/bash-completion/tar
lrwxrwxrwx   1 root root    34 2009-12-14 00:35 tcpdump -> /usr/share/bash-completion/tcpdump
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 vpnc -> /usr/share/bash-completion/vpnc
lrwxrwxrwx   1 root root    41 2009-12-14 00:35 wireless-tools -> /usr/share/bash-completion/wireless-tools
lrwxrwxrwx   1 root root    32 2009-12-14 00:35 wodim -> /usr/share/bash-completion/wodim
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 xmms -> /usr/share/bash-completion/xmms
lrwxrwxrwx   1 root root    29 2009-12-14 00:35 xz -> /usr/share/bash-completion/xz
lrwxrwxrwx   1 root root    35 2009-12-14 00:35 yp-tools -> /usr/share/bash-completion/yp-tools
lrwxrwxrwx   1 root root    31 2009-12-14 00:35 _yum -> /usr/share/bash-completion/_yum
-rw-r--r--   1 root root  6213 2009-11-08 08:40 yum-utils.bash

Best regards and thanks for your help!

- Armin

Comment 5 Ville Skyttä 2009-12-15 18:33:24 UTC
Ok, that explains it.  The triggers in bash-completion are not working as intended.  You can fix it for ssh locally by doing this as root:

ln -s /usr/share/bash-completion/ssh /etc/bash_completion.d

A bunch of other completions, namely bluez-utils, brctl, chsh, cpan2dist, dcop, dict, gnatmake, gpg, gpg2, imagemagick, isql, jar, java, lisp, lvm, lzma, mysqladmin, openldap, pkg-config, plague-client, qdbus, quota-tools, ri, rpcdebug, samba, shadow-utils, smartctl, svk, sysctl, vncviewer, xhost, xmllint, xmlwf, xrandr are not auto-installed due to this bug.  I'm working on a fix.

Comment 6 Fedora Update System 2009-12-15 22:37:02 UTC
bash-completion-1.1-4.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/bash-completion-1.1-4.fc12

Comment 7 Armin 2009-12-16 19:31:40 UTC
i just want to confirm that fixing it locally by creating the symlink you mentioned works for me!

thanks in advance for your work! :)

- armin

Comment 8 Fedora Update System 2009-12-18 04:39:27 UTC
bash-completion-1.1-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update bash-completion'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-13379

Comment 9 Mark Watts 2009-12-23 11:03:45 UTC
bash-completion-1.1-4.fc12 works perfectly for ssh known_hosts completion here.
Thanks.

Comment 10 Armin 2009-12-23 12:29:56 UTC
Hi,

I've tested it with the bash-completion from updates-testing and it works exactly like expected here on a freshly installed system. Again, thanks for your work.


Best regards,
- Armin

Comment 11 Fedora Update System 2009-12-23 21:30:11 UTC
bash-completion-1.1-4.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.