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 2040770

Summary: SFTP transfers not allowed by sshd configuration in Anaconda environment
Product: Red Hat Enterprise Linux 9 Reporter: Brian Lane <bcl>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: jstodola
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lorax-34.9.11-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 12:34:04 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 Brian Lane 2022-01-14 16:33:30 UTC
This bug was initially created as a copy of Bug #2035049

I am copying this bug because: 
generic templates in lorax should also be updated with this change.


Description of problem:
The 'scp' utility has been using SFTP protocol by default since OpenSSH 8.7. However, the sshd configuration in Anaconda environment hasn't reflected this situation and doesn't have the SFTP transfers enabled.

This leads to the necessity to add -O option when using scp to transfer files from/to the installation environment (with the 'inst.sshd' kernel command line option), otherwise the user gets an error from scp:

...
subsystem request failed on channel 0
Connection closed

This could potentailly lead to user confusion (the scp error is not very descriptive in relation to what the root cause is), so it would be worth to fix the Anaconda's sshd configuration. Just experimentally adding the following option to /etc/ssh/sshd_config.anaconda fixed the issue for me:

Subsystem sftp internal-sftp


Version-Release number of selected component (if applicable):
lorax-templates-rhel-9.0-28.el9

How reproducible:
100%

Steps to Reproduce:
1. Boot into installation environment with 'inst.sshd' on kernel command line
2. Switch into console
3. Transfer some file connecting to the local sshd instance using scp from OpenSSH >= 8.7 (it's OK to do just a transfer to/from localhost):

touch somefile
scp somefile localhost:/tmp


Actual results:
File transfer fails with 'subsystem request failed on channel 0' error.

Expected results:
File transfer is successful.

Additional info:
A workaround is to use -O option for the scp utility to fallback to SCP protocol.

Comment 2 Jan Stodola 2022-01-26 16:12:39 UTC
Content of /usr/share/lorax/templates.d/99-generic/config_files/common/sshd_config.anaconda in lorax-templates-generic-34.9.11-1.el9:

PermitRootLogin yes
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
SyslogFacility AUTHPRIV
PasswordAuthentication yes
PermitEmptyPasswords yes
PermitUserEnvironment yes
Subsystem sftp internal-sftp

The requested change is included, marking as Verified:Tested

Comment 5 Jan Stodola 2022-01-28 17:04:32 UTC
lorax-34.9.11-1.el9 is included in compose RHEL-9.0.0-20220127.4.

Moving to VERIFIED.

Comment 7 errata-xmlrpc 2022-05-17 12:34: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 (new packages: lorax), 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/RHBA-2022:2345