Bug 3284 - ssh-keygen does not respect the syntax for hostname with -F option
Summary: ssh-keygen does not respect the syntax for hostname with -F option
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-keygen (show other bugs)
Version: 8.4p1
Hardware: All Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-20 02:51 AEDT by Daniele Palumbo
Modified: 2022-02-25 13:59 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Palumbo 2021-03-20 02:51:04 AEDT
Hi,

I've tested the bug in gentoo (openssh v8.4p1) and osx big sur (openssh v8.1p1), still seems that i can't select more than one option in the Version list.

OSX:
$ ssh -V
OpenSSH_8.1p1, LibreSSL 2.7.3
$
Gentoo:
$ ssh -V
OpenSSH_8.4p1, OpenSSL 1.1.1g  21 Apr 2020
$

From the man page of ssh-keygen:
     -F hostname | [hostname]:port

I have hosts with ssh running on a different port, 
but for the sake of bug reproducer, let's remain on port 22.

I assume that the syntax is:
$ ssh-keygen -F 172.16.66.8:22

But, with the given syntax, port 22 and any other port fail

Example:
$ ssh-keygen -F 172.16.66.8:22 -v
$ echo $?
1

FWIW:
$ ssh-keygen -F [172.16.66.8]:22 -v
$ echo $?
1
$


Everything is working without any port specified:
$ ssh-keygen -F 172.16.66.8 -v
# Host 172.16.66.8 found: line 44
172.16.66.8 ecdsa-sha2-nistp256 [...]
$ echo $?
0
Comment 1 Damien Miller 2021-05-07 13:17:08 AEST
ssh-keygen -F '[172.16.66.8]:22' will work - the braces as shown in the manual are important, as otherwise there's no way to figure out where an IPv6 address ends and the port number begins.
Comment 2 Damien Miller 2022-02-25 13:59:09 AEDT
closing bugs resolved before openssh-8.9