RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1933517 - ssh-copy-id could not resolve ipv6 address ends with colon
Summary: ssh-copy-id could not resolve ipv6 address ends with colon
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: openssh
Version: 8.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Dmitry Belyavskiy
QA Contact: Marek Havrila
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-28 21:42 UTC by ZX
Modified: 2021-11-10 07:12 UTC (History)
4 users (show)

Fixed In Version: openssh-8.0p1-7.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:32:04 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to resolve the bug (488 bytes, patch)
2021-03-02 17:01 UTC, ZX
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4368 0 None None None 2021-11-09 19:32:25 UTC

Description ZX 2021-02-28 21:42:49 UTC
Description of problem:
ssh-copy-id could not resolve ipv6 address ends with colon

Version-Release number of selected component (if applicable):
openssh-8.0p1-5.el8.x86_64
openssh-7.4p1-21.el7.x86_64

How reproducible:

Steps to Reproduce:
1. run command 'ssh-copy-id 2001:db8::'

Actual results:
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: ERROR: ssh: Could not resolve hostname 2001:db8:: Name or service not known


Expected results:
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
The authenticity of host '2001:db8::' can't be established.
ECDSA key fingerprint is ......
Are you sure you want to continue connecting (yes/no/[fingerprint])? 


Additional info:

Comment 1 Jakub Jelen 2021-03-01 09:24:39 UTC
Does the pure "ssh" with this IP work? Does adding the address to the square braces as recommended by the manual page work?

Comment 2 ZX 2021-03-01 10:58:34 UTC
ssh 2001:db8:: --- works
ssh [2001:db8::] --- does not work
ssh-copy-id 2001:db8:: --- does not work
ssh-copy-id [2001:db8::] --- does not work

Comment 3 Jakub Jelen 2021-03-02 16:03:37 UTC
Unfortunately, I do not have any IPv6 address ending with colon to try with ...

Can you try with "set -x" to see what is being executed? The ssh-copy-id is just a bash script so it might help to see how it is executing ssh.

Comment 4 ZX 2021-03-02 16:59:52 UTC
Thank you Jakub Jelen, I found the bug in the bash script.

I've submitted a patch and it works.

Comment 5 ZX 2021-03-02 17:01:40 UTC
Created attachment 1760269 [details]
patch to resolve the bug

Comment 6 ZX 2021-03-02 17:24:26 UTC
Sorry the file is in packages:
openssh-clients-8.0p1-5.el8.x86_64
openssh-clients-7.4p1-21.el7.x86_64


And also, I noticed that upstream openssh-8.4p1 (September 2020) has fixed the bug.
We could consider updating the OpenSSH components to 8.4p1 in RHEL 7 and 8.

Comment 7 Jakub Jelen 2021-03-02 21:38:04 UTC
Thank you for debugging the issue and submitting a patch. I filled the following MR to update at least the comment, which was kept there even though the the code removing colon was no longer there.

We do not plan to update RHEL to newer versions, because we need to keep the RHEL stable. New OpenSSH 8.4p1 is available in Fedora. But we can patch the ssh-copy-id script in the next update of RHEL8. RHEL 7 now accepts only critical security fixes, which this indeed is not.

Comment 19 errata-xmlrpc 2021-11-09 19:32:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: openssh security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4368


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