AuthorizedKeysFile in match block will prevent default user login
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Confirmed
|
Low
|
Unassigned |
Bug Description
Hi.
Consider the following sshd_config which is pretty standard with only an added "Match" block.
-------
<...>
Port 22
AuthorizedKeysFile %h/.ssh/
<...>
Match group foobar
AuthorizedK
-------
When starting an instance pre-configured with the above sshd_config (in my case AWS EC2), cloud-init will parse /etc/ssh/
In this case, it will pick up the AuthorizedKeysFile value that is in the Match block because it's the last one in the file and will end up putting the default user key under /etc/ssh/
The obvious workaround is to append the default AuthorizedKeysFile at the end of the file but it would have been nice to know it beforehand ;-)
I understand that line-by-line parsing is the easy way, but in the case of ssh it is very error-prone and can lead to unexpected behaviour...
Thanks.
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Low |