bash completion no longer works for ssh known_hosts

Bug #211180 reported by Alex Chiang
4
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Fix Released
Undecided
Mika Fischer

Bug Description

Binary package hint: bash-completion

Running hardy beta. On latest nightly update, all of a sudden tab completion for ssh'ing to a known host fails.

achiang@soy:~$ cat .ssh/known_hosts | grep chizang
chizang.net ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAuAktWBn4hEKorEvVKB4TAVSEI7dHP+JO63C2Gy2fqSG/5N8JU9wUR8ivKJzMJlig/CyGPMHp65ogUwYDwuBkyxOZksLSh77FRCIqg18YgRTPTtVRfez/KVOEXO0cY9fzn2XCzB3UpXNyHGxvffBqseYPNS/OFf5k30wlwuqX51U=

achiang@soy:~$ cat .ssh/config | grep Hash
        HashKnownHosts no

achiang@soy:~$ ssh chi<tab>

does nothing.

Revision history for this message
Mika Fischer (zoop) wrote :

Hm, I can not reproduce this.

Can you please provide the output of the following commands:

complete -p ssh

dpkg -s bash-completion | egrep Status\|Version

Thanks!

Changed in bash-completion:
assignee: nobody → zoop
status: New → Incomplete
Revision history for this message
Alex Chiang (achiang) wrote :

achiang@soy:~$ complete -p ssh
complete -F _ssh ssh

achiang@soy:~$ dpkg -s bash-completion | egrep Status\|Version
Status: install ok installed
Version: 20060301-3ubuntu1

Revision history for this message
Mika Fischer (zoop) wrote :

Hm, do you by any chance have the UserKnownHostsFile option set in either /etc/ssh/ssh_config or ~/.ssh/config ?

Revision history for this message
Alex Chiang (achiang) wrote :

Yes, I do have that option set, but it's not set for that particular host.

Host proxies
        UserKnownHostsFile /dev/null
        StrictHostKeyChecking no

Host *
        TCPKeepAlive no
        ServerAliveCountMax 3
        ServerAliveInterval 10
        ControlMaster no
        ControlPath ~/.ssh/%r-%h-%p-mux
        HashKnownHosts no

Note that for the host I'm talking about above (chizang.net), I don't even have an entry at all:

achiang@soy:~$ grep chizang .ssh/config
achiang@soy:~$

Revision history for this message
Mika Fischer (zoop) wrote :

OK, that explains it then. bash_completion just greps the config for UserKnownHostsFile and uses that exclusively if found.

In your case that's obviously wrong. So I'll change it to use the standard files in addition to those found via UserKnownHostsFile.

That should fix it the problem.

Changed in bash-completion:
status: Incomplete → In Progress
Mika Fischer (zoop)
Changed in bash-completion:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash-completion - 20060301-3ubuntu2

---------------
bash-completion (20060301-3ubuntu2) hardy; urgency=low

  * Bugfix release:
   - Fix _get_cword more
   - Fix _command function to correctly prune the command line (LP: #103395)
   - Remove newline from options pattern for dpkg (LP: #138312)
   - Start readline-quoting arguments to compgen (LP: #123665)
   - Save and restore -v shell option (LP: #205444)
   - Prevent glob expansion in _filedir function (LP: #194419)
   - Quote glob expression in tar completion function (LP: #194419)
   - Complete AAS/SSA files for mplayer -sub (LP: #151086)
   - Disable completion of postgresql users and databases (LP: #164772)
   - Use files from UserKnownHostsFile options in addition to standard ones
     (LP: #211180)

 -- Mika Fischer <email address hidden> Sat, 05 Apr 2008 16:09:34 +0200

Changed in bash-completion:
status: Fix Committed → Fix Released
Revision history for this message
Alex Chiang (achiang) wrote :

Just a followup ACK that this fixes my problem.

Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.