Bug 1476758 - Rear's sshd fails to start when using "Match blocks" in SSHD configuration
Rear's sshd fails to start when using "Match blocks" in SSHD configuration
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rear (Show other bugs)
7.3
All Linux
unspecified Severity high
: rc
: ---
Assigned To: Pavel Cahyna
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-31 07:48 EDT by Renaud Métrich
Modified: 2018-02-01 04:14 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-01 04:14:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Renaud Métrich 2017-07-31 07:48:41 EDT
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.