Skip to content

ssh_utils.py: ignore when sshd_config options are not key/value pairs#1007

Merged
TheRealFalcon merged 2 commits intocanonical:mainfrom
esposem:value_error
Sep 8, 2021
Merged

ssh_utils.py: ignore when sshd_config options are not key/value pairs#1007
TheRealFalcon merged 2 commits intocanonical:mainfrom
esposem:value_error

Conversation

@esposem
Copy link
Contributor

@esposem esposem commented Sep 3, 2021

Proposed Commit Message

As specified in #LP 1845552,
In cloudinit/ssh_util.py, in parse_ssh_config_lines(), we attempt to
parse each line of sshd_config. This function expects each line to
be one of the following forms:

# comment
key value
key=value

However, options like DenyGroups and DenyUsers are specified to
optionally accepts values in sshd_config.
Cloud-init should comply to this and skip the option if a value
is not provided.

Signed-off-by: Emanuele Giuseppe Esposito eesposit@redhat.com

LP: #1845552
RHBZ:#1862933

Test Steps

Add the following line(s) to sshd_config

DenyUsers
DenyGroups

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

As specified in #LP 1845552,
In cloudinit/ssh_util.py, in parse_ssh_config_lines(), we attempt to
parse each line of sshd_config. This function expects each line to
be one of the following forms:

    \# comment
    key value
    key=value

However, options like DenyGroups and DenyUsers are specified to
*optionally* accepts values in sshd_config.
Cloud-init should comply to this and skip the option if a value
is not provided.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Copy link
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants