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 1476758 - Rear's sshd fails to start when using "Match blocks" in SSHD configuration
Summary: Rear's sshd fails to start when using "Match blocks" in SSHD configuration
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rear
Version: 7.3
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Pavel Cahyna
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-31 11:48 UTC by Renaud Métrich
Modified: 2018-02-01 09:14 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-01 09:14:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Renaud Métrich 2017-07-31 11:48:41 UTC
Description of problem:

When specifying a "Match block" in the /etc/ssh/sshd_config file on the machine to be backed up, rear's sshd started during recovery fails to start with the following error (not seen in systemd status):

/etc/ssh/sshd_config line 158: Directive 'PrintMotd' is not allowed within a Match block

This is due to the directive "PrintMotd no" being appended to the regular sshd_config file in rear archive, without prepending it by a "Match All" directive.

Generated sshd_config for rear:

RESCUE vm-rhel73:~ # tail /etc/ssh/sshd_config 

# Example of overriding settings on a per-user basis
Match User anoncvs
	X11Forwarding no
	AllowTcpForwarding no
	PermitTTY no
	ForceCommand cvs server
PrintMotd no


Should be:

RESCUE vm-rhel73:~ # tail /etc/ssh/sshd_config 

# Example of overriding settings on a per-user basis
Match User anoncvs
	X11Forwarding no
	AllowTcpForwarding no
	PermitTTY no
	ForceCommand cvs server
Match all
PrintMotd no


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

Relax-and-Recover 1.17.2 / Git (rear-1.17.2-9.el7_3.x86_64)

How reproducible:

Always

Steps to Reproduce:
1. Uncomment the "Match User anoncvs" in /etc/ssh/sshd_config file
2. Build the rear rescue image: rear mkrescue
3. Boot the rear rescue image

Actual results:

No sshd service being spawned.

# systemctl status sshd
* sshd.service - Relax-and-Recover sshd service
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2017-07-31 11:37:22 UTC; 3s ago
  Process: 430 ExecStart=/etc/scripts/run-sshd (code=exited, status=255)
 Main PID: 430 (code=exited, status=255)

Expected results:

sshd service be spawned.


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