Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2115377

Summary: Incorrect parsing of IPv6 IPs in ssh clients
Product: Red Hat Enterprise Linux 8 Reporter: Shreyas Mahangade <smahanga>
Component: opensshAssignee: Dmitry Belyavskiy <dbelyavs>
Status: CLOSED WORKSFORME QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 8.5CC: jjelen, mhavrila, sbroz
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-14 07:16:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Shreyas Mahangade 2022-08-04 14:41:29 UTC
Description of problem:
When using IPv6 for ssh connection it treats it as hostname.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Try to connect ssh with IPv6 with multiple use cases
2. 
3.

Actual results:
Note: IPs used are local IPs on lab machine

# sftp test@[fe80::f816:3eff:febd:d89e]
ssh: Could not resolve hostname [fe80::f816:3eff:febd:d89e]: Name or service not known
Connection closed.  
Connection closed

# ssh test@[fe80::f816:3eff:febd:d89e]
ssh: Could not resolve hostname [fe80::f816:3eff:febd:d89e]: Name or service not known

# ssh [fe80::f816:3eff:febd:d89e]
ssh: Could not resolve hostname [fe80::f816:3eff:febd:d89e]: Name or service not known

# sftp test@[fe80::f816:3eff:febd:d89e]
ssh: Could not resolve hostname [fe80::f816:3eff:febd:d89e]: Name or service not known
Connection closed.  
Connection closed


# sftp [fe80::f816:3eff:febd:d89e]
ssh: connect to host fe80::f816:3eff:febd:d89e port 22: Invalid argument
Connection closed.  
Connection closed

Loopback IP was parsed correctly

# sftp [::1]
ECDSA key fingerprint is SHA256:uMU1AbOclwdniyeyJBbzXjebd3qdU4yw2A2wBJqtv4g.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '::1' (ECDSA) to the list of known hosts.


Expected results:
Treat IPv6 block with IP and not hostname


Additional info:
This behavior changes for different IPs here. For above IP it is showing

Comment 3 Shreyas Mahangade 2022-08-12 13:24:03 UTC
It looks like issue might be related to this upstream bug:

   https://bugzilla.mindrot.org/show_bug.cgi?id=1602

Comment 9 Dmitry Belyavskiy 2023-02-07 12:19:00 UTC
Should be partially fixed for 8.x with https://bugzilla.redhat.com/show_bug.cgi?id=2162733

Comment 10 Dmitry Belyavskiy 2023-03-15 11:28:52 UTC
Is this bug still relevant, after https://bugzilla.redhat.com/show_bug.cgi?id=2162733 is shipped?