Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Match Group' in configuration but 'user' not in connection test specification #188

Closed
kravietz opened this issue Oct 29, 2018 · 3 comments · Fixed by #202
Closed

Match Group' in configuration but 'user' not in connection test specification #188

kravietz opened this issue Oct 29, 2018 · 3 comments · Fixed by #202
Assignees

Comments

@kravietz
Copy link

Describe the bug
The openssh.conf.j2 validity test fails in OpenSSH 7.7p1 (as distributed with Ubuntu 18.10) because sshd requires that specific user name is passed in the test context. I realize 18.10 is not supported officially but still worth keeping it for future reference.

Expected behavior
Just add any user to the test using -C option:
sshd -T -C user=someuser

Actual behavior
The test will always fail with the current test of /usr/sbin/sshd -T -f %s.

TASK [dev-sec.ssh-hardening : create sshd_config and set permissions to root/600] ***************************************************************************************************************************
fatal: [prol]: FAILED! => {"changed": false, "checksum": "d4665d47b3e4682db5a9a0a6f2978eabe296ea8c", "exit_status": 255, "msg": "failed to validate", "stderr": "'Match Group' in configuration but 'user' not in connection test specification.\r\n", "stderr_lines": ["'Match Group' in configuration but 'user' not in connection test specification."], "stdout": "", "stdout_lines": []}

Example Playbook

- hosts: prol
  roles:
  - dev-sec.ssh-hardening

OS / Environment

Ansible Version


Role Version


Additional context
Add any other context about the problem here.

@rndmh3ro rndmh3ro added the bug label Feb 2, 2019
@rndmh3ro
Copy link
Member

rndmh3ro commented Feb 2, 2019

You're right, I just tested this.
To make it work on all OS's I apparently have to use this:

sshd -T -C user=root -C host=localhost -C addr=localhost

@westurner
Copy link

#202 (comment)

This patch is also required for ssh 7.9p1. Does this work with older versions as well?

This would be great to have working.

@westurner
Copy link

westurner commented Apr 14, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants